angular-observe
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -94,2 +94,4 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
setState('loading', true); | ||
// Subscribe to the observable | ||
@@ -102,4 +104,2 @@ var observable = typeof source.subscribe === 'function' | ||
var subscription = observable.subscribe(onNext, onError, onComplete); | ||
setState('loading', true); | ||
@@ -106,0 +106,0 @@ // Unsubscribe when this element is destroyed |
@@ -1,1 +0,1 @@ | ||
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("angular")):"function"==typeof define&&define.amd?define(["angular"],n):"object"==typeof exports?exports.AngularObserve=n(require("angular")):e.AngularObserve=n(e.angular)}(this,function(e){return function(e){function n(t){if(r[t])return r[t].exports;var o=r[t]={exports:{},id:t,loaded:!1};return e[t].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=e,n.c=r,n.p="",n(0)}([function(e,n,r){var t=r(1);e.exports="filearts.angularObserve";var o=t.module(e.exports,[]);o.directive("observe",["$compile","$timeout",function(e,n){return{restrict:"EA",scope:!0,transclude:{loading:"?loading",active:"?active",complete:"?complete",error:"?error"},link:function(r,o,i,u,c){function l(e){r.$value=e,p("active")}function a(e){p("complete")}function s(e){r.$error=e,p("error")}function f(n,r,t){var o=r?t.contents():t;if(o.length){var i=e(o);g[n]=i}}function b(e){return{subscribe:function(n,r,o){return e.then(n,r,n)["catch"](function(e){return e}).then(o),{unsubscribe:t.noop}}}}function d(e){return{subscribe:function(r,o,i){return n(r.bind(null,e),0,!1).then(i),{unsubscribe:t.noop}}}}function p(e,n){if(e!==v){var t=g[e];if(o.empty(),!t)return;var i=t(r);o.append(i),v=e}n||r.$root.$$phase||r.$digest(!0)}var v,g={},m=r.$eval(i.observe||i.source);if(!m)return void console.warn("The `observable` directive requires a source observable.");if(c(f.bind(null,"active",!1),null,""),c(f.bind(null,"loading",!0),null,"loading"),c(f.bind(null,"active",!0),null,"active"),c(f.bind(null,"complete",!0),null,"complete"),c(f.bind(null,"error",!0),null,"error"),!g.active)return void console.warn("The `observable` directive requires at least one child element.");var x="function"==typeof m.subscribe?m:"function"==typeof m.then?b(m):d(m),h=x.subscribe(l,s,a);p("loading",!0),r.$on("$destroy",function(){h.unsubscribe()})}}}])},function(n,r){n.exports=e}])}); | ||
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("angular")):"function"==typeof define&&define.amd?define(["angular"],n):"object"==typeof exports?exports.AngularObserve=n(require("angular")):e.AngularObserve=n(e.angular)}(this,function(e){return function(e){function n(t){if(r[t])return r[t].exports;var o=r[t]={exports:{},id:t,loaded:!1};return e[t].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=e,n.c=r,n.p="",n(0)}([function(e,n,r){var t=r(1);e.exports="filearts.angularObserve";var o=t.module(e.exports,[]);o.directive("observe",["$compile","$timeout",function(e,n){return{restrict:"EA",scope:!0,transclude:{loading:"?loading",active:"?active",complete:"?complete",error:"?error"},link:function(r,o,i,u,c){function l(e){r.$value=e,p("active")}function a(e){p("complete")}function s(e){r.$error=e,p("error")}function f(n,r,t){var o=r?t.contents():t;if(o.length){var i=e(o);g[n]=i}}function b(e){return{subscribe:function(n,r,o){return e.then(n,r,n)["catch"](function(e){return e}).then(o),{unsubscribe:t.noop}}}}function d(e){return{subscribe:function(r,o,i){return n(r.bind(null,e),0,!1).then(i),{unsubscribe:t.noop}}}}function p(e,n){if(e!==v){var t=g[e];if(o.empty(),!t)return;var i=t(r);o.append(i),v=e}n||r.$root.$$phase||r.$digest(!0)}var v,g={},m=r.$eval(i.observe||i.source);if(!m)return void console.warn("The `observable` directive requires a source observable.");if(c(f.bind(null,"active",!1),null,""),c(f.bind(null,"loading",!0),null,"loading"),c(f.bind(null,"active",!0),null,"active"),c(f.bind(null,"complete",!0),null,"complete"),c(f.bind(null,"error",!0),null,"error"),!g.active)return void console.warn("The `observable` directive requires at least one child element.");p("loading",!0);var x="function"==typeof m.subscribe?m:"function"==typeof m.then?b(m):d(m),h=x.subscribe(l,s,a);r.$on("$destroy",function(){h.unsubscribe()})}}}])},function(n,r){n.exports=e}])}); |
{ | ||
"name": "angular-observe", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "Angular directive for representing the different states of an Observable.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/angular-observe.js", |
@@ -38,2 +38,4 @@ var Angular = require('angular'); | ||
setState('loading', true); | ||
// Subscribe to the observable | ||
@@ -46,4 +48,2 @@ var observable = typeof source.subscribe === 'function' | ||
var subscription = observable.subscribe(onNext, onError, onComplete); | ||
setState('loading', true); | ||
@@ -50,0 +50,0 @@ // Unsubscribe when this element is destroyed |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package