From dba91de34b4bf9d2f0127e26e3a12525204e48e2 Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Thu, 20 Aug 2015 02:19:18 +0200 Subject: [PATCH] showcase: Manually Identify Dependencies with ng-strict-di vs @ngInject --- angularjs/showcase/src/showcase/app/welcome/welcome.controller.js | 7 ++++++- angularjs/showcase/src/showcase/index.html | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/angularjs/showcase/src/showcase/app/welcome/welcome.controller.js b/angularjs/showcase/src/showcase/app/welcome/welcome.controller.js index 0b4b304..41ee92f 100644 --- a/angularjs/showcase/src/showcase/app/welcome/welcome.controller.js +++ b/angularjs/showcase/src/showcase/app/welcome/welcome.controller.js @@ -5,8 +5,13 @@ .module('app.welcome') .controller('Welcome', Welcome); + // When using
(strict mode) we must always + // manually identify dependencies. + // Instead I am going to use ngInject because it is cool :) + // Welcome.$inject = ['$location']; + /* @ngInject */ - function Welcome() { + function Welcome($location) { var vm = this; vm.hello = 'Hello World'; diff --git a/angularjs/showcase/src/showcase/index.html b/angularjs/showcase/src/showcase/index.html index 6eb7388..e0c1ced 100644 --- a/angularjs/showcase/src/showcase/index.html +++ b/angularjs/showcase/src/showcase/index.html @@ -76,6 +76,13 @@ This could be useful when using different frameworks in the same html application where one framework works with some DOM elements and another framework works with other DOM elements. --> +
-- 2.1.4