Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // appController.js
- $scope email = "Awesome@example.com";
- $scope.emailInfo = "great@example.com";
- //emailOnClick() is a ng-click on DOM. It will be triggered when the user click a button, which is to save his email information
- $scope.emailOnClick = function() {
- $scope.email = $scope.emailInfo;
- console.log($scope.email); //this will print "great@example.com".
- };
- console.log($scope.email); // this will print "awesome@example.com", but I
- //want it to print "great@example.com" as I triggered the ng-click function to
- //apply the change.
- console.log($scope.emailInfo); //this will print "great@example.com".
- $scope.emailOnClick = function() {
Add Comment
Please, Sign In to add comment