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) ...@@ -63,7 +63,7 @@ module.exports = function (grunt)
return url.replace('src/', ''); return url.replace('src/', '');
}, },
bootstrap: function (module, script) { bootstrap: function (module, script) {
return 'module.run([\'$templateCache\', function($templateCache) {\n' + script + '\n}]);'; return 'module.run(function($templateCache) {\n' + script + '\n});';
} }
} }
} }
...@@ -83,6 +83,21 @@ module.exports = function (grunt) ...@@ -83,6 +83,21 @@ module.exports = function (grunt)
{expand: true, flatten: true, src: ['src/rzslider.js'], dest: 'dist/'} {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']
}
]
}
} }
}); });
...@@ -91,9 +106,10 @@ module.exports = function (grunt) ...@@ -91,9 +106,10 @@ module.exports = function (grunt)
grunt.loadNpmTasks('grunt-recess'); grunt.loadNpmTasks('grunt-recess');
grunt.loadNpmTasks('grunt-angular-templates'); grunt.loadNpmTasks('grunt-angular-templates');
grunt.loadNpmTasks('grunt-replace'); grunt.loadNpmTasks('grunt-replace');
grunt.loadNpmTasks('grunt-ng-annotate');
grunt.registerTask('default', ['css', 'js']); grunt.registerTask('default', ['css', 'js']);
grunt.registerTask('css', ['recess']); 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) { ...@@ -1246,7 +1246,7 @@ function throttle(func, wait, options) {
return Slider; return Slider;
}]) }])
.directive('rzslider', ['RzSlider', function(Slider) .directive('rzslider', ['RzSlider', function(RzSlider)
{ {
'use strict'; 'use strict';
...@@ -1283,7 +1283,7 @@ function throttle(func, wait, options) { ...@@ -1283,7 +1283,7 @@ function throttle(func, wait, options) {
link: function(scope, elem, attr) link: function(scope, elem, attr)
{ {
return new Slider(scope, elem, attr); return new RzSlider(scope, elem, attr);
} }
}; };
}]); }]);
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
"grunt-angular-templates": "^0.5.7", "grunt-angular-templates": "^0.5.7",
"grunt-contrib-mincss": "~0.3.2", "grunt-contrib-mincss": "~0.3.2",
"grunt-contrib-uglify": "~0.2.2", "grunt-contrib-uglify": "~0.2.2",
"grunt-ng-annotate": "^1.0.1",
"grunt-recess": "~0.4.0", "grunt-recess": "~0.4.0",
"grunt-replace": "^0.11.0", "grunt-replace": "^0.11.0",
"recess": "~1.1.9" "recess": "~1.1.9"
......
...@@ -76,7 +76,7 @@ function throttle(func, wait, options) { ...@@ -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'; 'use strict';
...@@ -1244,9 +1244,9 @@ function throttle(func, wait, options) { ...@@ -1244,9 +1244,9 @@ function throttle(func, wait, options) {
}; };
return Slider; return Slider;
}]) })
.directive('rzslider', ['RzSlider', function(Slider) .directive('rzslider', function(RzSlider)
{ {
'use strict'; 'use strict';
...@@ -1283,10 +1283,10 @@ function throttle(func, wait, options) { ...@@ -1283,10 +1283,10 @@ function throttle(func, wait, options) {
link: function(scope, elem, attr) link: function(scope, elem, attr)
{ {
return new Slider(scope, elem, attr); return new RzSlider(scope, elem, attr);
} }
}; };
}]); });
// IDE assist // 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