Search code examples
javascriptangularjsng-annotate

How to use ng-annotate directions


how exactly do you run ng-annotate from the command line? Im trying to minify angular, angular_routes and my own script.js into one file. Ive tried grunt uglify:app1 but it gives the injection error. My own code works when minified by itself but not when combined with the angular scripts.here is the grunt file

grunt.initConfig({
    ngAnnotate: {
        options: {
            singleQuotes: true,
        },
        app1: {
            files: {
                'min.js': ['angular.js','angular_routes.js','script.js'],

            },
        },


    },
});

grunt.loadNpmTasks('grunt-ng-annotate');

I dont know what the command is to run it.


Solution

  • Add this to your grunt file:

    grunt.registerTask('default', ['ngAnnotate']);
    

    And then just run grunt in the console