Judgment statement:
<Ling-repeat= " personIn persons "><spanNg-switch on= "Person.sex"><spanNg-switch-when= "1〃>You is a boy</span><spanNg-switch-when= "2〃>You are a girl</span></span><spanng-if= "Person.sex==1〃>You could be a father</span><spanNg-show= "Person.sex==2〃>You could be a mother</span></Li>
Filter:
$scope. Childrenarray = [ {name: ' Kimi ', age:3}, {name: ' Cindy ', Age:4}, {name: ' Anglar ', age:4}, {name : ' Shitou ', age:6}, {name: ' Tiantian ', age:5} ];//filter (matching substring) {{Childrenarray | filter: ' A '}}//Match attribute value containing a in {{ Childrenarray | Filter:4}} //Match attribute value contains 4 {{Childrenarray | filter: {name: ' I '}}}//parameter is an object that matches the {{Childrenarray | filter with I in the name attribute: Func}} //parameter is a function that specifies the return age>4 of the
View Code
//Case<DivNg-controller= "Mainctrl"> <H3>{{Originaltext}}</H3> <H3>{{Filteredtext}}</H3></Div>//jsangular.module (' filterexample ', []). Controller (' Mainctrl ', function ($scope, $filter) {$scope. Originaltext = ' Hello '; $scope. Filteredtext = $filter (' uppercase ') ($scope. originaltext);});View Code
AngularJS Basic Usage