Guest User

Untitled

a guest
Nov 17th, 2017
389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. // appController.js
  2.  
  3. $scope email = "Awesome@example.com";
  4.  
  5. $scope.emailInfo = "great@example.com";
  6.  
  7. //emailOnClick() is a ng-click on DOM. It will be triggered when the user click a button, which is to save his email information
  8.  
  9. $scope.emailOnClick = function() {
  10.  
  11. $scope.email = $scope.emailInfo;
  12.  
  13. console.log($scope.email); //this will print "great@example.com".
  14.  
  15. };
  16.  
  17. console.log($scope.email); // this will print "awesome@example.com", but I
  18.  
  19. //want it to print "great@example.com" as I triggered the ng-click function to
  20.  
  21. //apply the change.
  22.  
  23.  
  24. console.log($scope.emailInfo); //this will print "great@example.com".
  25.  
  26. $scope.emailOnClick = function() {
Add Comment
Please, Sign In to add comment