Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- name: Blank snippet
- description: ''
- author: amritha-dilip
- host: WEB
- api_set: {}
- script:
- content: |
- $("#run").click(run);
- function run() {
- angular.module('demo')
- .factory('blah', ['$timeout', ($timeout: ng.ITimeoutService) => {
- var timeouts = {};
- function checkProgress(promise) {
- promise.then(() => {
- this.timeout = $timeout(() => checkProgress(promise), 1000);
- }).catch(e => {
- this.timeout = $timeout(() => checkProgress(promise), 1000);
- });
- }
- return {
- queueTask: (action) => {
- // define an upload action that returns a promise;
- var promise = upload(action);
- checkProgress(promise);
- }
- }
- }])
- }
- language: typescript
- template:
- content: |
- <button id="run" class="ms-Button">
- <span class="ms-Button-label">Run</span>
- </button>
- language: html
- style:
- content: "/* Your style goes here */\r\n"
- language: css
- libraries: |
- @types/angular
- angular
- jquery
- @types/jquery
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement