first commit

This commit is contained in:
didier amyot committed 2014-12-27 17:27:21 -08:00
commit 823ecdd500
26 files changed
+2110

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
define ["angular", "services"], (angular) ->
# Controllers
# Sample controller where service is being used
# More involved example where controller is required from an external file
controllers = angular.module("myApp.controllers", ["myApp.services"])
controllers.controller("MyCtrl1", [
"$scope"
"$injector"
($scope, $injector) ->
require ["controllers/myctrl1"], (myctrl1) ->
# injector method takes an array of modules as the first argument
# if you want your controller to be able to use components from
# any of your other modules, make sure you include it together with 'ng'
# Furthermore we need to pass on the $scope as it's unique to this controller
$injector.invoke(myctrl1, this, {$scope: $scope})
return
])
controllers.controller( "MyCtrl2", [
"$scope"
"$injector"
($scope, $injector) ->
require ["controllers/myctrl2"], (myctrl2) ->
# injector method takes an array of modules as the first argument
# if you want your controller to be able to use components from
# any of your other modules, make sure you include it together with 'ng'
# Furthermore we need to pass on the $scope as it's unique to this controller
$injector.invoke(myctrl2, this, {$scope: $scope})
return
])