One way data binding in Angular2

前端 未结 4 1928
情歌与酒
情歌与酒 2020-12-08 08:39

I got the following html


I want the data and columns properties to

4条回答
  •  广开言路
    2020-12-08 09:20

    Firstly, you need to understand what databinding means in Angular?

    What are Databindings ?

    "Data bindings are expressions embedded into templates and are evaluated to produce dynamic content in the HTML document. Data bindings provide the link between the HTML elements in the HTML document and in template files with the data and code in the application."(from Pro Angular book)

    [target]: expression

    The square brackets indicate a one-way data binding where data flows from the expression to the target. One-way databindings in only one direction, which data flows from component to html template file.

    {{expression}}

    String interpolation binding, that is used to include expression results in the text content of host elements.

    (target) ="expr"

    The round brackets indicate a one-way binding where the data flows from the target to the destination specified by the expression. This is the binding used to handle events.

    [(target)] ="expr"

    This combination of brackets—known as the banana-in-a-box—indicates a two-way binding, where data flows in both directions between the target and the destination specified by the expression.

提交回复
热议问题