Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

#angular-nested-include

angular-nested-include is an angular.js module that decorates ng-include to allow running an expression after all nested ng-include finished loading.

installation

Get angular-nested-include:

Add angularNestedInclude dependency to your app.

Usage


    --------- app.js ---------
    angular.module("myApp",['angularNestedInclude'])
        .controller("myCtrl",function(scope){
            scope.callAfterLoad= function(){
                //innerDiv should be visible in this function
            }
        })
    
    --------- index.html -------------
    <html ng-app="myApp">
    <script type="text/ng-template" id="/outerTemplate.html">
      <div ng-include="'/innerTpl.html'"></div>
    </script>
    <script type="text/ng-template" id="/innerTemplate.html">
          <div id="innerDiv"></div>
    </script>
    <body ng-controller="myCtrl">
        <div ng-include="'/outerTemplate.html'" on-nested-load="callAfterLoad()"></div>
    </body>
    </html>
    

disclaimer:

angular-nested-include decorates all ng-include directives.
This can cause unexpected slowdowns and might not interact well with other modules that modify or depend on ng-cinlude.

About

ng-include's onload that is called after nested ng-includes are compiled.

Resources

License

Packages

No packages published