Guest User

Untitled

a guest
Dec 14th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. <button type="button" class="btn btn-primary" ng-click="$ctrl.showCode()">Test Code</button>
  2. <button type="button" class="btn btn-primary" ng-click="$ctrl.clearCode()">Reset All</button>
  3.  
  4. {{$ctrl.codeShow}}
  5.  
  6. angular.
  7. module('phonecatApp').
  8. component('testCode', {
  9. templateUrl: 'Components/test-code/test-code.template.html',
  10. controller: [function TestCodeController() {
  11. var self = this;
  12.  
  13. self.code = '';
  14. self.codeShow = '';
  15.  
  16. self.showCode = function showCode()
  17. {
  18. self.codeShow = self.code;
  19. }
  20.  
  21. self.clearCode = function clearCode()
  22. {
  23. self.codeShow = '';
  24. self.code = '';
  25. }
  26.  
  27. }]
  28. });
Add Comment
Please, Sign In to add comment