zoukankan      html  css  js  c++  java
  • AngularJs中directive的延迟加载

    app.js代码

    1 var faceApp = angular.module('faceApp', ['ngRoute', 'faceApp.services', 'faceApp.filters', 'ngDialog','ngFileUpload', 'checklist-model']);
    2 faceApp.config(function ($httpProvider, $compileProvider) {
    3    
    4 
    5     //$compileProvider服务用来延迟注册directive
    6     faceApp.compileProvider    = $compileProvider;

    directive.js代码

     1 .directive('multiselectDropdown', [function() {
     2         return function(scope, element) {
     3             // Below setup the dropdown:
     4             element.multiselect({
     5                 buttonClass: 'btn btn-small',
     6                 buttonWidth: '200px',
     7                 nonSelectedText: '全部',//没有值的时候button显示值
     8                 includeSelectAllOption: true,
     9                 selectAllText: '全选',//全选的checkbox名称
    10                 maxHeight: 200
    11             });
    12         }
    13     }]);

    【CSDN中相关文章阅读】

  • 相关阅读:
    无缝轮播图
    瀑布流之ajax
    进阶版轮播图
    桌面特效
    3D模型文字动画
    Razor 常用方法
    easyui常用
    C#
    Redis设置记录
    日志三剑客ELK
  • 原文地址:https://www.cnblogs.com/miny-simp/p/7744530.html
Copyright © 2011-2022 走看看