日期:2014-05-16 浏览次数:20350 次
1、调用
指令调用可以ng:bind
, ng-bind
, ng_bind
, x-ng-bind
, data-ng-bind
这些方式
<!doctype html> <html ng-app> <head> <script src="http://code.angularjs.org/angular-1.1.0.min.js"></script> <script src="script.js"></script> </head> <body> <div ng-controller="Ctrl1"> Hello <input ng-model='name'> <hr/> <span ng:bind="name"> <span ng:bind="name"></span> <br/> <span ng_bind="name"> <span ng_bind="name"></span> <br/> <span ng-bind="name"> <span ng-bind="name"></span> <br/> <span data-ng-bind="name"> <span data-ng-bind="name"></span> <br/> <span x-ng-bind="name"> <span x-ng-bind="name"></span> <br/> </div> </body> </html>
function Ctrl1($scope) { $scope.name = 'angular'; }
html
<!doctype html> <html ng-app="time"> <head> <script src="http://code.angularjs.org/angular-1.1.0.min.js"></script>