Commit 4974c952 authored by e-cloud's avatar e-cloud

apply ngAnnotate plugin to the build flow

parent c9bb9817
......@@ -63,7 +63,7 @@ module.exports = function (grunt)
return url.replace('src/', '');
},
bootstrap: function (module, script) {
return 'module.run([\'$templateCache\', function($templateCache) {\n' + script + '\n}]);';
return 'module.run(function($templateCache) {\n' + script + '\n});';
}
}
}
......@@ -83,17 +83,33 @@ module.exports = function (grunt)
{expand: true, flatten: true, src: ['src/rzslider.js'], dest: 'dist/'}
]
}
},
ngAnnotate: {
options: {
singleQuotes: true,
},
rzslider: {
files: [{
'dist/rzslider.js': 'dist/rzslider.js'
}, {
expand: true,
src: ['dist/rzslider.js']
}
]
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-recess');
grunt.loadNpmTasks('grunt-angular-templates');
grunt.loadNpmTasks('grunt-replace');
grunt.loadNpmTasks('grunt-ng-annotate');
grunt.registerTask('default', ['css', 'js']);
grunt.registerTask('css', ['recess']);
grunt.registerTask('js', ['ngtemplates','replace', 'uglify']);
grunt.registerTask('js', ['ngtemplates','replace', 'ngAnnotate', 'uglify']);
};
......@@ -1246,7 +1246,7 @@ function throttle(func, wait, options) {
return Slider;
}])
.directive('rzslider', ['RzSlider', function(Slider)
.directive('rzslider', ['RzSlider', function(RzSlider)
{
'use strict';
......@@ -1283,7 +1283,7 @@ function throttle(func, wait, options) {
link: function(scope, elem, attr)
{
return new Slider(scope, elem, attr);
return new RzSlider(scope, elem, attr);
}
};
}]);
......
......@@ -16,6 +16,7 @@
"grunt-angular-templates": "^0.5.7",
"grunt-contrib-mincss": "~0.3.2",
"grunt-contrib-uglify": "~0.2.2",
"grunt-ng-annotate": "^1.0.1",
"grunt-recess": "~0.4.0",
"grunt-replace": "^0.11.0",
"recess": "~1.1.9"
......
......@@ -76,7 +76,7 @@ function throttle(func, wait, options) {
};
})
.factory('RzSlider', ['$timeout', '$document', '$window', 'throttle', function($timeout, $document, $window, throttle)
.factory('RzSlider', function($timeout, $document, $window, throttle)
{
'use strict';
......@@ -1244,9 +1244,9 @@ function throttle(func, wait, options) {
};
return Slider;
}])
})
.directive('rzslider', ['RzSlider', function(Slider)
.directive('rzslider', function(RzSlider)
{
'use strict';
......@@ -1283,10 +1283,10 @@ function throttle(func, wait, options) {
link: function(scope, elem, attr)
{
return new Slider(scope, elem, attr);
return new RzSlider(scope, elem, attr);
}
};
}]);
});
// IDE assist
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment