Questions tagged [ng-annotate]

ng-annotate adds and removes AngularJS dependency injection annotations.

ng-annotate is non-intrusive so your source code stays exactly the same otherwise. No lost comments or moved lines. Annotations are useful because with them you're able to minify your source code using your favorite JS minifier.

The package is hosted on GitHub.

25 questions
1
vote
3 answers

What is the best practice for dependency injection annotation with AngularJS?

So thanks to ng-annotate, now we can minify our code successfully when it looks like this: angular.module('YeomanApp') .controller('YeoCtrl', function ($scope) { $scope.awesomeThings = [ 'HTML5 Boilerplate', 'AngularJS', 'Karma' …
user3704512
  • 151
  • 10
0
votes
0 answers

grunt ngAnnotate and uglify problem with anonymous functions

given a function function config(LOCALES, $translateProvider, $translatePartialLoaderProvider, tmhDynamicLocaleProvider, $stateProvider, $urlRouterProvider, $httpProvider, $provide, localStorageServiceProvider, AclServiceProvider, $compileProvider,…
0
votes
1 answer

How to use 'babel-plugin-angularjs-annotate' in GULP

I am getting this error when i try and build with GULP [18:48:23] 'makeScripts' errored after 2.53 s [18:48:23] Error in plugin "gulp-ng-annotate" Message: metisMenu.js: error: couldn't process source due to parse error Unexpected token…
LukePerrin
  • 235
  • 5
  • 17
0
votes
1 answer

Destination folder with ngAnnotate

My project folder looks like this: project __src ____main ______webapp ________WEB-INF __________app ____________components //Angular files here. I have a grunt task with ng-annotate with this configuration: ngAnnotate: { …
Padron Leandro
  • 313
  • 1
  • 4
  • 16
0
votes
1 answer

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…
user718229
  • 524
  • 6
  • 20
0
votes
1 answer

Injection not working with ng-annotate and babel on Angular 1.X

I'm using ES6 codestyle and implement a sample module like this: import angular from 'angular'; import { IndicatorSelectorComponent } from './indicatorSelector.component'; import './indicatorSelector.css'; export const IndicatorSelectorModule =…
rafrcruz
  • 117
  • 7
0
votes
2 answers

Using ng-annotate without Grant or Gulp

How to use ng-annotate module, when I have Gradle Build Tool and no Grant or Gulp in project? I need minimize my code.
Serhio g. Lazin
  • 9,442
  • 6
  • 25
  • 33
0
votes
1 answer

Grunt ng-annotate copies complete directory

I have configured Grunt to use ng-annotate. What I want is to annotate all .js files in a specific directory and copy them to a new directory when the annotation is finished. However, the complete src folder is copied to the new directory. This is…
YourReflection
  • 375
  • 7
  • 22
0
votes
0 answers

Failed to instantiate angularjs module. Because it says it's not using explicit annotation and cannot be invoked in strict mode

I wish to use ng-annotate and the following syntax in my app (using ng-strict-di) to avoid minification issues but I keep getting this error in the console as if I was missing the /** ng@Inject */ comment above the routeConfig function. What am I…
Gab
  • 2,216
  • 4
  • 34
  • 61
0
votes
0 answers

Problems with gulp and ng-annotate

I'm using gulp for my project. While saving the changes made in my Controller, it is not getting updated in my app.js(which contains all the .js code that i have used). In my command prompt, I get this as the result while saving the js…
Senthil Kumar J
  • 208
  • 2
  • 13
1
2