Skip to content

Instantly share code, notes, and snippets.

@asicfr
Created October 22, 2014 16:02
Show Gist options
  • Save asicfr/4c3eb936deb28117d0a5 to your computer and use it in GitHub Desktop.
Save asicfr/4c3eb936deb28117d0a5 to your computer and use it in GitHub Desktop.
(function () {
angular.module('myApp', []);
var myCtrl = function ($scope) {
console.log("declare myCtrl");
$scope.itWasUsed = false;
$scope.myvalue = 'value initial';
$scope.useIt = function () {
console.log("call real useIt function");
$scope.itWasUsed = true;
};
$scope.dontUseIt = function () {
console.log("call real dontUseIt function");
$scope.itWasUsed = false;
};
};
myCtrl.$inject = ['$scope'];
// bind ctrl on module
angular.module('myApp').controller('MyCtrl', myCtrl);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment