angular-observe
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -91,5 +91,5 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
// Lift the source to an Observable-compatible interface | ||
var observable = typeof source.subscribe === 'function' | ||
var observable = source && typeof source.subscribe === 'function' | ||
? source | ||
: typeof source.then === 'function' | ||
: source && typeof source.then === 'function' | ||
? liftPromise(source) | ||
@@ -96,0 +96,0 @@ : liftValue(source); |
@@ -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("asyncBind",["$compile","$q","$rootScope","$timeout",function(e,n,r,o){function u(e){var n=a(e);return function(e,t,o){function u(e){function n(e){var n=typeof e;return"boolean"===n||"number"===n||"string"===n}var r=!n(v.$value)||!n(e);v.$value=e,f("active",r)}function a(e){f("complete")}function s(e){v.$error=e,f("error")}function f(e,r){if(r||e!==l){var o=n[e];if(p&&p.$destroy(),!o)return void t.empty();p=v.$new(),l=e,o(p,function(e){t.empty(),t.append(e)})}v.$root.$$phase||v.$digest(!0)}var p,l,d,v=r.$new(!0,e),b=o.asyncBind||o.source;t.empty(),e.$watch(b,function(e){d&&d.unsubscribe(),f("loading");var n="function"==typeof e.subscribe?e:"function"==typeof e.then?c(e):i(e);d=n.subscribe(u,s,a)}),e.$on("$destroy",function(){d&&d.unsubscribe()})}}function c(e){return{subscribe:function(n,r,o){var u=!1,c=function(e){return n(e),e},i=function(e){r(e),u=!0},a=function(){u||o()};return e.then(c,i,n).then(a),{unsubscribe:t.noop}}}}function i(e){return{subscribe:function(n,r,u){return o(n.bind(null,e),0,!1).then(u),{unsubscribe:t.noop}}}}function a(n){var r={},o={loading:[],active:[],error:[],complete:[]},u=[];t.forEach(n.contents(),function(e){switch(e.nodeName.toLowerCase()){case"loading":return o.loading.push(e);case"active":return o.active.push(e);case"error":return o.error.push(e);case"complete":return o.complete.push(e);default:return u.push(e)}});var c=!1;if(t.forEach(o,function(n,o){if(n.length){c=!0;var u=t.element(n).clone();r[o]=e(u)}}),!c){u.length||u.push(document.createTextNode("{{$value}}"));var i=t.element(u).clone();r.active=e(i),r.complete=e(i.clone())}return r}return{restrict:"EA",scope:!0,compile:u}}])},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("asyncBind",["$compile","$q","$rootScope","$timeout",function(e,n,r,o){function u(e){var n=a(e);return function(e,t,o){function u(e){function n(e){var n=typeof e;return"boolean"===n||"number"===n||"string"===n}var r=!n(v.$value)||!n(e);v.$value=e,f("active",r)}function a(e){f("complete")}function s(e){v.$error=e,f("error")}function f(e,r){if(r||e!==l){var o=n[e];if(p&&p.$destroy(),!o)return void t.empty();p=v.$new(),l=e,o(p,function(e){t.empty(),t.append(e)})}v.$root.$$phase||v.$digest(!0)}var p,l,d,v=r.$new(!0,e),b=o.asyncBind||o.source;t.empty(),e.$watch(b,function(e){d&&d.unsubscribe(),f("loading");var n=e&&"function"==typeof e.subscribe?e:e&&"function"==typeof e.then?c(e):i(e);d=n.subscribe(u,s,a)}),e.$on("$destroy",function(){d&&d.unsubscribe()})}}function c(e){return{subscribe:function(n,r,o){var u=!1,c=function(e){return n(e),e},i=function(e){r(e),u=!0},a=function(){u||o()};return e.then(c,i,n).then(a),{unsubscribe:t.noop}}}}function i(e){return{subscribe:function(n,r,u){return o(n.bind(null,e),0,!1).then(u),{unsubscribe:t.noop}}}}function a(n){var r={},o={loading:[],active:[],error:[],complete:[]},u=[];t.forEach(n.contents(),function(e){switch(e.nodeName.toLowerCase()){case"loading":return o.loading.push(e);case"active":return o.active.push(e);case"error":return o.error.push(e);case"complete":return o.complete.push(e);default:return u.push(e)}});var c=!1;if(t.forEach(o,function(n,o){if(n.length){c=!0;var u=t.element(n).clone();r[o]=e(u)}}),!c){u.length||u.push(document.createTextNode("{{$value}}"));var i=t.element(u).clone();r.active=e(i),r.complete=e(i.clone())}return r}return{restrict:"EA",scope:!0,compile:u}}])},function(n,r){n.exports=e}])}); |
{ | ||
"name": "angular-observe", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Angular directive for representing the different states of an Observable.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/angular-observe.js", |
@@ -35,5 +35,5 @@ var Angular = require('angular'); | ||
// Lift the source to an Observable-compatible interface | ||
var observable = typeof source.subscribe === 'function' | ||
var observable = source && typeof source.subscribe === 'function' | ||
? source | ||
: typeof source.then === 'function' | ||
: source && typeof source.then === 'function' | ||
? liftPromise(source) | ||
@@ -40,0 +40,0 @@ : liftValue(source); |
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
21242