From c7a385a2e8708008280cfbe454a542dba0853708 Mon Sep 17 00:00:00 2001 From: Mehdy Dara Date: Wed, 1 Jul 2015 16:53:02 +0200 Subject: [PATCH] Add 'ngInject' directive in CoffeeScript file && replace " by ' fix #647 fix #638 --- app/templates/src/app/_index.config.coffee | 3 ++- app/templates/src/app/_index.run.coffee | 3 ++- app/templates/src/app/_ngroute/__ngroute.coffee | 13 +++++++------ app/templates/src/app/_uirouter/__uirouter.coffee | 13 +++++++------ .../_githubContributor.service.coffee | 3 ++- .../components/malarkey/_malarkey.directive.coffee | 3 ++- .../app/components/navbar/_navbar.directive.coffee | 3 ++- .../components/webDevTec/_webDevTec.service.coffee | 5 +++-- app/templates/src/app/main/_main.controller.coffee | 5 +++-- 9 files changed, 30 insertions(+), 21 deletions(-) diff --git a/app/templates/src/app/_index.config.coffee b/app/templates/src/app/_index.config.coffee index 74a6944c..fda722cc 100644 --- a/app/templates/src/app/_index.config.coffee +++ b/app/templates/src/app/_index.config.coffee @@ -1,5 +1,6 @@ -angular.module "<%- appName %>" +angular.module '<%- appName %>' .config ($logProvider, toastr) -> + 'ngInject' # Enable log $logProvider.debugEnabled true # Set options third-party lib diff --git a/app/templates/src/app/_index.run.coffee b/app/templates/src/app/_index.run.coffee index 8a742647..f5d3c7b4 100644 --- a/app/templates/src/app/_index.run.coffee +++ b/app/templates/src/app/_index.run.coffee @@ -1,3 +1,4 @@ -angular.module "<%- appName %>" +angular.module '<%- appName %>' .run ($log) -> + 'ngInject' $log.debug 'runBlock end' diff --git a/app/templates/src/app/_ngroute/__ngroute.coffee b/app/templates/src/app/_ngroute/__ngroute.coffee index 039386fe..a3e134fc 100644 --- a/app/templates/src/app/_ngroute/__ngroute.coffee +++ b/app/templates/src/app/_ngroute/__ngroute.coffee @@ -1,9 +1,10 @@ -angular.module "<%- appName %>" +angular.module '<%- appName %>' .config ($routeProvider) -> + 'ngInject' $routeProvider - .when "/", - templateUrl: "app/main/main.html" - controller: "MainController" - controllerAs: "main" + .when '/', + templateUrl: 'app/main/main.html' + controller: 'MainController' + controllerAs: 'main' .otherwise - redirectTo: "/" + redirectTo: '/' diff --git a/app/templates/src/app/_uirouter/__uirouter.coffee b/app/templates/src/app/_uirouter/__uirouter.coffee index 0d4b2560..e1ef7175 100644 --- a/app/templates/src/app/_uirouter/__uirouter.coffee +++ b/app/templates/src/app/_uirouter/__uirouter.coffee @@ -1,10 +1,11 @@ -angular.module "<%- appName %>" +angular.module '<%- appName %>' .config ($stateProvider, $urlRouterProvider) -> + 'ngInject' $stateProvider - .state "home", - url: "/" - templateUrl: "app/main/main.html" - controller: "MainController" - controllerAs: "main" + .state 'home', + url: '/' + templateUrl: 'app/main/main.html' + controller: 'MainController' + controllerAs: 'main' $urlRouterProvider.otherwise '/' diff --git a/app/templates/src/app/components/githubContributor/_githubContributor.service.coffee b/app/templates/src/app/components/githubContributor/_githubContributor.service.coffee index e05e9e19..514c05c1 100644 --- a/app/templates/src/app/components/githubContributor/_githubContributor.service.coffee +++ b/app/templates/src/app/components/githubContributor/_githubContributor.service.coffee @@ -1,5 +1,6 @@ -angular.module "<%- appName %>" +angular.module '<%- appName %>' .factory 'githubContributor', ($log, $http) -> + 'ngInject' apiHost = 'https://api.github.com/repos/Swiip/generator-gulp-angular' getContributors = (limit) -> diff --git a/app/templates/src/app/components/malarkey/_malarkey.directive.coffee b/app/templates/src/app/components/malarkey/_malarkey.directive.coffee index 2b5a821e..d51407f1 100644 --- a/app/templates/src/app/components/malarkey/_malarkey.directive.coffee +++ b/app/templates/src/app/components/malarkey/_malarkey.directive.coffee @@ -1,7 +1,8 @@ -angular.module "<%- appName %>" +angular.module '<%- appName %>' .directive 'acmeMalarkey', -> MalarkeyController = ($log, githubContributor) -> + 'ngInject' vm = this activate = -> diff --git a/app/templates/src/app/components/navbar/_navbar.directive.coffee b/app/templates/src/app/components/navbar/_navbar.directive.coffee index 7e6815ca..85422e8d 100644 --- a/app/templates/src/app/components/navbar/_navbar.directive.coffee +++ b/app/templates/src/app/components/navbar/_navbar.directive.coffee @@ -1,7 +1,8 @@ -angular.module "<%- appName %>" +angular.module '<%- appName %>' .directive 'acmeNavbar', -> NavbarController = (moment) -> + 'ngInject' vm = this # "vm.creation" is avaible by directive option "bindToController: true" vm.relativeDate = moment(vm.creationDate).fromNow() diff --git a/app/templates/src/app/components/webDevTec/_webDevTec.service.coffee b/app/templates/src/app/components/webDevTec/_webDevTec.service.coffee index c495b9e1..fe9ebf5d 100644 --- a/app/templates/src/app/components/webDevTec/_webDevTec.service.coffee +++ b/app/templates/src/app/components/webDevTec/_webDevTec.service.coffee @@ -1,5 +1,6 @@ -angular.module "<%- appName %>" - .service "webDevTec", () -> +angular.module '<%- appName %>' + .service 'webDevTec', () -> + 'ngInject' data = <%- technologies %> getTec = -> diff --git a/app/templates/src/app/main/_main.controller.coffee b/app/templates/src/app/main/_main.controller.coffee index 1d248ca5..28a7dea9 100644 --- a/app/templates/src/app/main/_main.controller.coffee +++ b/app/templates/src/app/main/_main.controller.coffee @@ -1,5 +1,6 @@ -angular.module "<%- appName %>" - .controller "MainController", ($timeout, webDevTec, toastr) -> +angular.module '<%- appName %>' + .controller 'MainController', ($timeout, webDevTec, toastr) -> + 'ngInject' vm = this activate = -> getWebDevTec()