Skip to content

Instantly share code, notes, and snippets.

@orafaelfragoso
Last active February 10, 2018 18:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orafaelfragoso/4215570f08216da4e6bd to your computer and use it in GitHub Desktop.
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
'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