1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
| var testModule = angular.module('test', ['oc.lazyLoad']);
|
| testModule.config(['$ocLazyLoadProvider', function($ocLazyLoadProvider) {
| $ocLazyLoadProvider.config({
| jsLoader: requirejs,
| debug: true
| });
| }]);
|
| testModule.controller('mainController', ['$scope', '$ocLazyLoad', function($scope, $ocLazyLoad) {
| $scope.test = "Hi there";
| $scope.partialUrl = '';
|
| $scope.load = function() {
| $ocLazyLoad.load('lazymodule').then(function() {
| $scope.partialUrl = 'partials/grid.html';
| }, function(e) {
| console.log(e);
| });
| }
| }]);
|
|