摘要:
<meta charset="utf-8"><script src="https://cdn.bootcss.com/angular.js/1.4.6/angular.min.js"></script></head><body> <h2>验证实例</h2> <form ng-app="myApp" 阅读全文
摘要:
在模块定义中 [] 参数用于定义模块的依赖关系。中括号[]表示该模块没有依赖,如果有依赖的话会在中括号写上依赖的模块名字。 JavaScript 中应避免使用全局函数。因为他们很容易被其他脚本文件覆盖。 AngularJS 模块让所有函数的作用域在该模块下,避免了该问题。 对于 HTML 应用程序, 阅读全文
摘要:
除了 AngularJS 内置的指令外,我们还可以创建自定义指令。 你可以使用 .directive 函数来添加自定义的指令。 要调用自定义指令,HTML 元素上需要添加自定义指令名。 使用驼峰法来命名一个指令, runoobDirective, 但在使用它时需要以 - 分割, runoob-dir 阅读全文
摘要:
ng-click 指令定义了 AngularJS 点击事件。<button ng-click="count = count + 1">点我!</button> 当然还有函数 阅读全文
摘要:
ng-disable 将数据绑定到h5元素的disable属性 比如: <div ng-app="" ng-init="mySwitch=true"><p><button ng-disabled="mySwitch">点我!</button></p><p><input type="checkbox" 阅读全文
摘要:
<head><meta charset="utf-8"><script src="https://cdn.bootcss.com/angular.js/1.6.3/angular.min.js"></script><style>table, th , td { border: 1px solid g 阅读全文
摘要:
ng-init 设置默认选中值。<div ng-app="myApp" ng-controller="myCtrl"> <select ng-init="selectedName = names[0]" ng-model="selectedName" ng-options="x for x in n 阅读全文