angularjs - ngannotate-rails not working in development mode -


i'm using ngannotate-rails angular code work in compressed format. in rails 3.2 + angular 1.5.x app.

i've added following gemfile , ran bundle

group :assets   gem 'sprockets-derailleur', '~> 1.0.0'          # speed precompiles multi-core compile   gem 'turbo-sprockets-rails3', '~> 0.3.14'       # compile changed assets   gem 'sass-rails', ' ~> 3.2'                   # main css extension in use   gem 'less', '~> 2.6.0'                          # less required ui-utils plugin angularjs   gem 'therubyracer', '~> 0.12.1'                 # v8 library required less   gem 'coffee-rails'                              # language compiles js   gem 'uglifier'                      # js parser, minifier, compressor or beautifier toolkit    gem 'ngannotate-rails', '~> 1.2'                # angularjs minifier end 

then in config/environments/development.rb i've added following

  if env['ng_force'] == 'true'     config.assets.compress = true     config.assets.compile = true     config.assets.digest = true     config.assets.debug = false      # don't fallback assets pipeline if precompiled asset missed     config.assets.precompile += %w(*.css *.js *.woff *.eot *.svg *.ttf) # fix font-awesome    else     # not compress assets     config.assets.compress = false      # expands lines load assets     config.assets.debug = true   end 

i following commands ng-annotate not annotating

ng_force=true rails_env=development bundle exec rake assets:clean assets:precompile:primary ng_force=true rails s 

i check compiled output in public/assets/.../ , @ top;

(function(){var e;e=function(e,n,t,i,o,c,r,a,u,d,s,l,v,f,g,h,m,p,b,k,y,i,t,e,q,w,a){var d,p,f,x,j; 

it's minified not annotated strings angularjs throws error;

application-57db964b9323e90284f1f3c331c9c3aa.js:43 error: [$injector:unpr] unknown provider: eprovider <- e <- invoicescontroller http://errors.angularjs.org/1.5.7/$injector/unpr?p0=eprovider%20%3c-%20e%20%3c-%20invoicescontroller     @ http://localhost:3000/assets/application-57db964b9323e90284f1f3c331c9c3aa.js:41:28591     @ http://localhost:3000/assets/application-57db964b9323e90284f1f3c331c9c3aa.js:42:16654     @ object.r [as get] (http://localhost:3000/assets/application-57db964b9323e90284f1f3c331c9c3aa.js:42:15610)     @ http://localhost:3000/assets/application-57db964b9323e90284f1f3c331c9c3aa.js:42:16739     @ r (http://localhost:3000/assets/application-57db964b9323e90284f1f3c331c9c3aa.js:42:15610)     @ o (http://localhost:3000/assets/application-57db964b9323e90284f1f3c331c9c3aa.js:42:15910)     @ object.s [as instantiate] (http://localhost:3000/assets/application-57db964b9323e90284f1f3c331c9c3aa.js:42:16247)     @ http://localhost:3000/assets/application-57db964b9323e90284f1f3c331c9c3aa.js:43:9470     @ http://localhost:3000/assets/application-57db964b9323e90284f1f3c331c9c3aa.js:98:32136     @ object.<anonymous> (http://localhost:3000/assets/application-57db964b9323e90284f1f3c331c9c3aa.js:47:31053) <div id="wrapper" class="ui-wrapper ng-scope" ui-view=""> 

update

invoicescontroller

invoicescontroller = ($scope, $http, $location, $state, $stateparams, $uibmodal, $timeout, flash, invoice, division, costing, job, jobservice, common, shortcutservice, invoiceservice, timesheetservice, disbursementservice, debtorservice, searchservice, lineitemservice, dateservice, $filter, $mddialog, $mdmedia, restangular, hotkeys) ->  <snip: long>   switch $state.current.name     # index      when "invoices"       $scope.query = searchservice.getfilter('invoices')       page = searchservice.getpage('invoices')        if ($scope.query)         # filter exists         $scope.filterform = true         getinvoices(angular.extend({}, $scope.query, {page: page, limit: 10, search: $scope.query}))       else if page > 0         $scope.query = { order: '-invoice_no', limit: 10,  page: page }         $scope.onpaginate(page, 10)       else         $scope.resetfilter()    <snip>  angular   .module('paisapp')   .controller('invoicescontroller', invoicescontroller) 

although might have been cut off in snippet above, don't see have provided "nginject" directive in code.

i expect controller code

mycontroller = ($scope, ...) ->   "nginject"   # etc 

it's "nginject" ng-annotate looks hook in points when transpiling code.


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -