AngularJS: lazy loading controllers and content

后端 未结 9 860
小鲜肉
小鲜肉 2020-12-02 19:00

In this simplified scenario, I have two files: index.htm, lazy.htm.

index.htm:

var myApp = angular.module(\'myApp\', []);
myApp.controller(\'embed\',         


        
9条回答
  •  执念已碎
    2020-12-02 19:45

    You also can use Directives to load your controller!

    A example here:

    https://gist.github.com/raphaelluchini/53d08ed1331e47aa6a87

提交回复
热议问题