Last active
February 10, 2018 18:44
-
-
Save orafaelfragoso/4215570f08216da4e6bd to your computer and use it in GitHub Desktop.
An Angular 1.X controller example using objects and prototype to prevent $scope soup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var NoScopeSoup = function($scope) { | |
var _this = this; | |
_this.myDataString = 'My Data'; | |
}; | |
NoScopeSoup.prototype.getMyData = function() { | |
return this.myDataString; | |
}; | |
NoScopeSoup.$inject = ['$scope']; | |
angular.module('gotidyHomekeeper').controller('NoScopeSoup', NoScopeSoup); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment