Skip to content

Instantly share code, notes, and snippets.

@ncammarata
Created March 2, 2014 07:34
Show Gist options
  • Select an option

  • Save ncammarata/9303241 to your computer and use it in GitHub Desktop.

Select an option

Save ncammarata/9303241 to your computer and use it in GitHub Desktop.
// in body ng-controller="MainCtrl as main"
this.app.controller('MainCtrl', function($scope) {
this.first = "willy";
this.last = "wonka";
self = this;
$scope.$watch('first + last', function(val) {
self.fullName = self.first + ' ' + self.last
});
return this;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment