![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
angularJS1.x 学习
Buamd
这个作者很懒,什么都没留下…
展开
-
angular1.x中的ng-if和ng-show的区别以及ng-if的作用域
ng-if :表达式内值为true是,生成标签内的DOM,否则移除; ng-show:表达式内值为true是,显示标签内的DOM,否则隐藏。 ng-if同no-show和ng-hide指令最本质的区别是,它不是通过CSS显示或隐藏DOM节点,而是真正生成或移除节点。 ng-if 表达式内的值初始为false的时候 他里面的由input的 model绑定的scope是不会存在作用域里面的,当if的值为true的时候,相当于生成了一个新的SCOPE值,但是原先的watch仍然是检测不到新生成的model的原创 2020-05-12 17:42:06 · 550 阅读 · 0 评论 -
AngularJS1.x 自定义指令(directive)
自定义指令(directive) 要调用自定义指令,HTML 元素上需要添加自定义指令名。 使用驼峰法来命名一个指令, myDirective, 但在使用它时需要以-分割,my-directive: <my-directive></my-directive> <script> var app = angular.module("myApp", [...原创 2019-07-22 16:22:49 · 690 阅读 · 0 评论 -
AngularJS1.x 事件指令
AngularJS:事件指令 事件指令: ng-click / ng-dblclick 单击 / 双击; ng-mousedown / up 鼠标按下 / 抬起; ng-mousemove / over / out 鼠标移动 / 移入 / 移出 ; ng-keydown / up / press 键盘按下 / ...原创 2019-07-22 15:23:26 · 359 阅读 · 0 评论 -
AngularJS1.x 的内置过滤器
1,uppercase,lowercase大小转换 {{ "hello world" | uppercase }} //结果:HELLO WORLD {{ "NG is ANGULARJS" | lowercase }} //结果:ng is angularjs 2,json格式化 {{ {foo: "bar", baz: 23} | json }} //结果:{ "fo...原创 2019-07-23 10:35:45 · 121 阅读 · 0 评论 -
AngularJS1.x 自定filter功能
自定filter功能 1,filters.js添加一个module angular.module('mytest', []).filter('myreplace', function() { return function(input) { return input.replace(/my/, "=====") }; }); 2,app.js中加载这个module...原创 2019-07-23 10:59:39 · 261 阅读 · 0 评论