angular-observe
Advanced tools
Comparing version 3.0.2 to 3.1.0
@@ -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){e.exports=r(2)},function(n,r){n.exports=e},function(e,n,r){var t=r(1);e.exports="filearts.angularObserve";var o=t.module(e.exports,[]);o.provider("asyncBindConfig",[function(){this.fromValue=function(){throw new Error("You need to overwrite `asyncBindConfig.fromValue`.")},this.fromPromise=function(){throw new Error("You need to overwrite `asyncBindConfig.fromPromise`.")},this.map=function(){throw new Error("You need to overwrite `asyncBindConfig.map`.")},this.switchMap=function(){throw new Error("You need to overwrite `asyncBindConfig.switchMap`.")},this.$get=function(){return this}}]),o.directive("asyncBind",["$compile","$q","$rootScope","$timeout","asyncBindConfig",function(e,n,r,o,i){function u(e,n){var t=(n.asyncBind||n.source).split(/\s+as\s+/i),o=t.shift().split("."),u=t[0]||"$value",s=o.shift(),f=a(e,u);return function(e,n,t){function a(e){function n(e){var n=typeof e;return"boolean"===n||"number"===n||"string"===n}var r=!n(g[u])||!n(e);g[u]=e,d("active",r)}function p(e){d("complete")}function l(e){g.$error=e,d("error")}function d(e,r){if(r||e!==h){var t=f[e];if(m&&m.$destroy(),!t)return void n.empty();m=g.$new(),h=e,t(m,function(e){n.empty(),n.append(e)})}g.$root.$$phase||g.$digest(!0)}var m,h,v,g=r.$new(!0,e);n.empty(),e.$watch(s,function(e){function n(e){var n=e.shift(),t=e;return function(e){var o=e[n];return o?r(t,o):i.fromValue()}}function r(e,r){var t=c(r);return e.length?i.switchMap.call(t,n(e)):t}v&&(v.unsubscribe(),v=null),v=r(o,e).subscribe(a,l,p),d("loading")}),e.$on("$destroy",function(){v&&(v.unsubscribe(),v=null)})}}function c(e){return e&&"function"==typeof e.subscribe?e:e&&"function"==typeof e.then?i.fromPromise(e):i.fromValue(e)}function a(n,r){var o={},i={loading:[],active:[],error:[],complete:[]},u=[];t.forEach(n.contents(),function(e){switch(e.nodeName.toLowerCase()){case"loading":return i.loading.push(e);case"active":return i.active.push(e);case"error":return i.error.push(e);case"complete":return i.complete.push(e);default:return u.push(e)}});var c=!1;if(t.forEach(i,function(n,r){if(n.length){c=!0;var i=t.element(n).clone();o[r]=e(i)}}),!c){u.length||u.push(document.createTextNode("{{"+r+"}}"));var a=t.element(u).clone();o.active=e(a),o.complete=e(a.clone())}return o}return{restrict:"EA",scope:!0,compile:u}}])}])}); | ||
!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){e.exports=r(1)},function(e,n,r){var t=r(2);e.exports="filearts.angularObserve";var o=t.module(e.exports,[]);o.provider("asyncBindConfig",[function(){this.fromValue=function(){throw new Error("You need to overwrite `asyncBindConfig.fromValue`.")},this.fromPromise=function(){throw new Error("You need to overwrite `asyncBindConfig.fromPromise`.")},this.map=function(){throw new Error("You need to overwrite `asyncBindConfig.map`.")},this.switchMap=function(){throw new Error("You need to overwrite `asyncBindConfig.switchMap`.")},this.$get=function(){return this}}]),o.directive("asyncBind",["$compile","$q","$rootScope","$timeout","asyncBindConfig",function(e,n,r,o,i){function u(e,n){var t=(n.asyncBind||n.source).split(/\s+as\s+/i),o=t.shift().split("."),u=t[0]||"$value",s=o.shift(),f=a(e,u);return function(e,n,t){function a(e){function n(e){var n=typeof e;return"boolean"===n||"number"===n||"string"===n}var r=!n(g[u])||!n(e);g[u]=e,d("active",r)}function p(e){d("complete")}function l(e){g.$error=e,d("error")}function d(e,r){if(r||e!==h){var t=f[e];if(m&&m.$destroy(),!t)return void n.empty();m=g.$new(),h=e,t(m,function(e){n.empty(),n.append(e)})}g.$root.$$phase||g.$digest(!0)}var m,h,v,g=r.$new(!0,e);n.empty(),e.$watch(s,function(e){function n(e){var n=e.shift(),t=e;return function(e){var o=e[n];return o?r(t,o):i.fromValue()}}function r(e,r){var t=c(r);return e.length?i.switchMap.call(t,n(e)):t}v&&(v.unsubscribe(),v=null),v=r(o,e).subscribe(a,l,p),d("loading")}),e.$on("$destroy",function(){v&&(v.unsubscribe(),v=null)})}}function c(e){return e&&"function"==typeof e.subscribe?e:e&&"function"==typeof e.then?i.fromPromise(e):i.fromValue(e)}function a(n,r){var o={},i={loading:[],active:[],error:[],complete:[]},u=[];t.forEach(n.contents(),function(e){switch(e.nodeName.toLowerCase()){case"loading":return i.loading.push(e);case"active":return i.active.push(e);case"error":return i.error.push(e);case"complete":return i.complete.push(e);default:return u.push(e)}});var c=!1;if(t.forEach(i,function(n,r){if(n.length){c=!0;var i=t.element(n).clone();o[r]=e(i)}}),!c){u.length||u.push(document.createTextNode("{{"+r+"}}"));var a=t.element(u).clone();o.active=e(a),o.complete=e(a.clone())}return o}return{restrict:"EA",scope:!0,compile:u}}])},function(n,r){n.exports=e}])}); |
{ | ||
"name": "angular-observe", | ||
"version": "3.0.2", | ||
"version": "3.1.0", | ||
"description": "Angular directive for representing the different states of an Observable.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/angular-observe.js", |
@@ -1,2 +0,2 @@ | ||
# Introducing the `observe` directive | ||
# Introducing the `async-bind` directive | ||
@@ -3,0 +3,0 @@ Subscribe to an observable and render different markup depending on the observable's state. |
@@ -52,13 +52,8 @@ var _ = require('lodash'); | ||
entry: { | ||
'angular-observe.rx.next': __dirname + '/compat/rx.next', | ||
'angular-observe.rxjs-es': __dirname + '/compat/rxjs-es', | ||
}, | ||
externals: { | ||
'@reactivex/rx': { | ||
commonjs: '@reactivex/rx', | ||
commonjs2: '@reactivex/rx', | ||
amd: 'rx', | ||
root: 'Rx' | ||
}, | ||
'rxjs-es': 'rxjs-es', | ||
}, | ||
}, baseConfig), | ||
]; |
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
62745
1116