1. Common directives
1 <DivNg-controller= "Jsyd-controller">2 <Divstyle= "float:left;width:100%; "Ng-show= "clickvalue1== ' Registration '">3 4 <Divng-include src= "'/partials/11.html '"></Div>5 6 </Div>7 <Divclass= "Item"Ng-class= "{true: ' item ', false: ' item2 '}[clickvalue== ' accept ']">8 9 <ul>Ten One <Divng-disabled= "Isdisable"Ng-click= "clickvalue= ' Accept '">Reception information</Div> A - </ul> - the </Div> - </Div>
Ng-class, Ng-show, ng-disabled, Ng-if, Ng-hide
Assigning values when loading pages (focus: Ng-class's CSS assignment operation)
$scope. Clickvalue = ' admissibility ';
$scope. clickvalue1= ' Registration ';
$scope. Isdisable=true;
2. Row selection
1 <Table>2 <theadstyle= "Background-color: #e4e9ef;">3 <TR>4 <TDclass= "TD"style= "width:10%">Serial number</TD>5 <TDclass= "TD"style= "width:20%">Parcel Code</TD>6 <TDclass= "TD"style= "width:10%">Parcel Area</TD>7 <TDclass= "TD"style= "width:30%">Operation</TD>8 </TR>9 </thead>Ten <tbody> One <TRNg-class= ' {selected:ZJDFG==selectedrow} 'Ng-click= "Tdxxclick (ZJDFG)"ng-repeat= "ZJDFG in Zjdfglist"> A <TDclass= "TD"Ng-bind= "$index +1">1</TD> - <TDclass= "TD">{{ZJDFG. ZDDM}}</TD> - <TDclass= "TD">{{ZJDFG. ZDMJ}}</TD> the <TDclass= "TD"> - <aname={{postitem. Id}}type= "button"Ng-click= "CHECKZJDFG (ZJDFG)">View</a> - <aname={{postitem. Id}}type= "button"Ng-show= "Isck"ng- - Show= "Isshowback"ng-disabled= "Isdisable"Ng-click= "EDITZJDFG (ZJDFG)">Edit</a> + <aname={{postitem. Id}}type= "button"Ng-show= "Isck"ng- - Show= "Isshowback"Ng-click= "DELETEZJDFG (zjdfg.id)">Delete</a> + </TD> A </TR> at </tbody> - </Table>
The application of Ng-click, Ng-repeat and Ng-class
Row selection
$scope. Tdxxclick = function (data) {
$scope. selectedrow = data;
}
3. Drop-down frame ng-options, Ng-model application
<ng-model= "Qllxcode" ng-options= "option. Code as option. Name for option in Qllx "></Select>
Js:
var add = {"Name": "--Please select--", "Code": "1"= [{code:1,name: ' Nihao '},{code:2,name: ' Nihao '}]; if NULL ) = $scope. Qllx[0]. Code;
4.radio button
1 < value= "{{item.id}}" name= "Ztfaxz" type= "Radio" Ng-model = "meischecked" Ng-click = "Meclick (item.id)" />
Js:
// $scope is selected when value and meischecked are equal . meischecked = $scope. Custom.meid;
5.checkbox
1 <DivNg-model= "Permissiongroups"class= "Post_roles">2 <labelng-repeat= "Roleitem in Permissiongroups"class= "Role_name"style= "width:175px;">3 <inputtype= "checkbox"Ng-model= "roleitem.ischecked" /> <label>{{Roleitem.name}}</label>4 </label>5 </Div>
Js:
// true to select $scope. postiteminfo.permissiongroups = [];angular.foreach ($scope. permissiongroups,function (value, key) { if (value.ischecked) { $scope. PostItemInfo.PermissionGroups.push (value.id); }});
Angularjs Summary (v) instruction application and assignment operation of common control