angularJS如何在页面生成之后再执行其他的js脚本代码
2016-09-26 10:26
281 查看
js文件:
app.directive('onFinishRenderFilters', function($timeout) {
return {
restrict:'A',//以属性的形式应用(E 作为元素名使用,A 作为属性使用,C 作为类名使用,M 作为注释使用)
link : function(scope, element, attr) {
if (scope.$last === true) {
$timeout(function() {
scope.$emit('hideElement');
});
}
}
};
});
$scope.$on('hideElement', function(hideElement) {
$(".dellabel").hide();
});
HTML文件:
<a ng-click="show(t.task_id)" class="tablelink dellabel" on-finish-render-filters> 删除</a>
app.directive('onFinishRenderFilters', function($timeout) {
return {
restrict:'A',//以属性的形式应用(E 作为元素名使用,A 作为属性使用,C 作为类名使用,M 作为注释使用)
link : function(scope, element, attr) {
if (scope.$last === true) {
$timeout(function() {
scope.$emit('hideElement');
});
}
}
};
});
$scope.$on('hideElement', function(hideElement) {
$(".dellabel").hide();
});
HTML文件:
<a ng-click="show(t.task_id)" class="tablelink dellabel" on-finish-render-filters> 删除</a>
相关文章推荐
- AngularJs中,如何在ng-repeat完成之后,执行Js脚本
- 如何去掉kingcms生成页面代码中的fun.js引用等信息(转载未查证)
- AngularJs中,如何在render完成之后,执行Js脚本
- 如何确保页面中的js加载完全后再执行其他代码
- js 生成密匙流 脚本代码
- js如何获取jsp页面中嵌入的java代码中的变量?
- 如何抓取Js动态生成数据且以滚动页面方式分页的网页
- 如何在一个网站或者一个页面,去书写你的JS代码
- javascript 调用其他页面的js函数或变量的脚本
- 如何优化js代码(3)――减少页面的重绘
- jquery mobile框架,用超链接定位到其他页面,会出现不能跳转或者跳转后页面js代码不能执行现象
- SharePoint 2013 开发过程中如何使依赖多个JS文件的代码,等依赖的多个文件下载完成后再执行
- 有了jsRender,妈妈再也不用担心我用jq拼接DOM拼接的一团糟了、页面整齐了、其他伙伴读代码也不那么费劲了
- main主函数执行完之后再执行其他代码的方法
- Jquery和Js如何在页面触发回车事件(或者其他html控件)
- js 点击页面其他地方关闭弹出层(示例代码)
- 从select中选择option后如何转到相应的数据页面中去的JS代码
- 如何在页面调用JS函数的代码
- javascript 调用其他页面的js函数或变量的脚本
- 如何引入js脚本代码