Two-way data binding
Data binding is probably the coolest and most practical feature of ANGULARJS. It helps you avoid writing large amounts of initial code to save development time. A typical Web application might contain 80% of the code used to process, query, and listen to the DOM. Data binding is less code and you can focus on your application.
Example one:
<input type= "text" ng-model= "user.name" placeholder= "Please enter name" >
The contents of H1 will change with the content in input, which reduces the number of operations and makes the code more concise.
Filter (matched substring)Used to process an array, and then filter out the elements containing a substring to return as a subarray. Can be an array of strings, or an array of objects. If it is an array of objects, you can match the value of the property. It receives a parameter that defines the matching rules for the substring. Here's an example to illustrate the use of parameters:
$scope. Childrenarray = [
{name: ' Kimi ', Age:3},
{name: ' Cindy ', Age:4},
{name: ' Anglar ', age:4},
{name: ' Shitou ', age:6},
{name: ' Tiantian ', age:5}
];
$scope. Func = function (e) {return e.age>4;} {{Childrenarray | filter: ' A '}}//Match attribute value contains a
{{Childrenarray | filter:4}}//Match attribute value contains 4
{{Childrenarray | filter: {name: ' I '}}}//parameter is an object that matches the name attribute containing I
{{Childrenarray | filter:func}}//parameter is a function that specifies the return age>4 of the
Note: Filter ":" After the parameters are written, you must add a space symbol, or you will get an error.
ANGULARJS Study Summary