Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. name: Blank snippet
  2. description: ''
  3. author: amritha-dilip
  4. host: WEB
  5. api_set: {}
  6. script:
  7. content: |
  8. $("#run").click(run);
  9.  
  10. function run() {
  11. angular.module('demo')
  12. .factory('blah', ['$timeout', ($timeout: ng.ITimeoutService) => {
  13. var timeouts = {};
  14.  
  15. function checkProgress(promise) {
  16. promise.then(() => {
  17. this.timeout = $timeout(() => checkProgress(promise), 1000);
  18. }).catch(e => {
  19. this.timeout = $timeout(() => checkProgress(promise), 1000);
  20. });
  21. }
  22.  
  23. return {
  24. queueTask: (action) => {
  25. // define an upload action that returns a promise;
  26. var promise = upload(action);
  27. checkProgress(promise);
  28. }
  29. }
  30. }])
  31. }
  32. language: typescript
  33. template:
  34. content: |
  35. <button id="run" class="ms-Button">
  36. <span class="ms-Button-label">Run</span>
  37. </button>
  38. language: html
  39. style:
  40. content: "/* Your style goes here */\r\n"
  41. language: css
  42. libraries: |
  43. @types/angular
  44. angular
  45.  
  46. jquery
  47. @types/jquery
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement