您的位置:首页 > Web前端 > AngularJS

angular经验

2016-07-05 00:00 127 查看
##绑定的变量和方法失效
原因:html里面元素没有配对闭合,导致无法识别

###广播事件
整个 AngularJS框架,只有三个事件被发射 ($includeContentRequested, $includeContentLoaded, $viewContentLoaded), 和7个事件被传播 ($locationChangeStart, $locationChangeSuccess, $routeUpdate, $routeChangeStart, $routeChangeSuccess, $routeChangeError, $destroy).
####$locationChangeStart
路由变换前事件
####$locationChangeSuccess
路由变换成功后事件
####$viewContentLoaded
fired once the view is loaded, after the DOM is rendered. The '$scope' of the view emits the event."

###TypeError: 'scopeName' 为空或不是对象<div class=ng-scope ui-view>
原因是view的html语法错误。tr被div包裹了,删除div即可

###Unknown provider: tProvider <- t
一般是controller,service,directive等引入其他service时未声明。
错误:.directive('datePicker',function($timeout){
正确方法.directive('datePicker',['$timeout',function($timeout){

##html安全处理
http://www.mamicode.com/info-detail-322397.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: