angular2-aspnet
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -80,3 +80,3 @@ System.registerDynamic("angular2-aspnet/Validation", ["angular2/http.js"], true, function($__require, exports, module) { | ||
var CacheHitConnection = (function() { | ||
function CacheHitConnection(req, responseBody, baseResponseOptions) { | ||
function CacheHitConnection(req, cachedResponse, baseResponseOptions) { | ||
this.request = req; | ||
@@ -87,4 +87,4 @@ this.readyState = http_1.ReadyStates.Done; | ||
var response = new http_1.Response(new http_1.ResponseOptions({ | ||
body: responseBody, | ||
status: 200 | ||
body: cachedResponse.body, | ||
status: cachedResponse.statusCode | ||
})); | ||
@@ -91,0 +91,0 @@ responseObserver.next(response); |
@@ -1,1 +0,1 @@ | ||
System.registerDynamic("angular2-aspnet/Validation",["angular2/http.js"],!0,function(a,b,c){var d=this,e=d.define;d.define=void 0;var f=a("angular2/http.js"),g=function(){function a(){}return a.showValidationErrors=function(a,b){if(a instanceof f.Response){var c=a;a=c.json()}var d=a;Object.keys(d||{}).forEach(function(a){d[a].forEach(function(c){b.controls[a].errors||(b.controls[a]._errors={}),b.controls[a].errors[c]=!0})})},a}();return b.Validation=g,d.define=e,c.exports}),System.registerDynamic("angular2-aspnet/CachePrimedHttp",["angular2/core.js","angular2/http.js","@reactivex/rxjs/dist/cjs/Observable.js"],!0,function(a,b,c){var d=this,e=d.define;d.define=void 0;var f=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},g=this&&this.__decorate||function(a,b,c,d){var e,f=arguments.length,g=3>f?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)g=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;h>=0;h--)(e=a[h])&&(g=(3>f?e(g):f>3?e(b,c,g):e(b,c))||g);return f>3&&g&&Object.defineProperty(b,c,g),g},h=a("angular2/core.js"),i=a("angular2/http.js"),j=function(a){function b(b,c){a.call(this),this._underlyingBackend=b,this._baseResponseOptions=c,this._preCachedResponses=window.__preCachedResponses||{}}return f(b,a),b.prototype.createConnection=function(a){var b=a.url;return a.method===i.RequestMethods.Get&&this._preCachedResponses.hasOwnProperty(b)?new k(a,this._preCachedResponses[b],this._baseResponseOptions):this._underlyingBackend.createConnection(a)},b=g([h.Injectable()],b)}(i.ConnectionBackend);b.CachePrimedConnectionBackend=j;var k=function(){function b(b,c,d){this.request=b,this.readyState=i.ReadyStates.Done;var e=a("@reactivex/rxjs/dist/cjs/Observable.js");this.response=new e(function(a){var b=new i.Response(new i.ResponseOptions({body:c,status:200}));a.next(b),a.complete()})}return b}();return b.CACHE_PRIMED_HTTP_PROVIDERS=[h.provide(i.Http,{useFactory:function(a,b,c){return new i.Http(new j(a,c),b)},deps:[i.XHRBackend,i.RequestOptions,i.ResponseOptions]})],d.define=e,c.exports}),System.registerDynamic("angular2-aspnet",["angular2-aspnet/CachePrimedHttp","angular2-aspnet/Validation"],!0,function(a,b,c){function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}var e=this,f=e.define;return e.define=void 0,d(a("angular2-aspnet/CachePrimedHttp")),d(a("angular2-aspnet/Validation")),e.define=f,c.exports}); | ||
System.registerDynamic("angular2-aspnet/Validation",["angular2/http.js"],!0,function(a,b,c){var d=this,e=d.define;d.define=void 0;var f=a("angular2/http.js"),g=function(){function a(){}return a.showValidationErrors=function(a,b){if(a instanceof f.Response){var c=a;a=c.json()}var d=a;Object.keys(d||{}).forEach(function(a){d[a].forEach(function(c){b.controls[a].errors||(b.controls[a]._errors={}),b.controls[a].errors[c]=!0})})},a}();return b.Validation=g,d.define=e,c.exports}),System.registerDynamic("angular2-aspnet/CachePrimedHttp",["angular2/core.js","angular2/http.js","@reactivex/rxjs/dist/cjs/Observable.js"],!0,function(a,b,c){var d=this,e=d.define;d.define=void 0;var f=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},g=this&&this.__decorate||function(a,b,c,d){var e,f=arguments.length,g=3>f?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)g=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;h>=0;h--)(e=a[h])&&(g=(3>f?e(g):f>3?e(b,c,g):e(b,c))||g);return f>3&&g&&Object.defineProperty(b,c,g),g},h=a("angular2/core.js"),i=a("angular2/http.js"),j=function(a){function b(b,c){a.call(this),this._underlyingBackend=b,this._baseResponseOptions=c,this._preCachedResponses=window.__preCachedResponses||{}}return f(b,a),b.prototype.createConnection=function(a){var b=a.url;return a.method===i.RequestMethods.Get&&this._preCachedResponses.hasOwnProperty(b)?new k(a,this._preCachedResponses[b],this._baseResponseOptions):this._underlyingBackend.createConnection(a)},b=g([h.Injectable()],b)}(i.ConnectionBackend);b.CachePrimedConnectionBackend=j;var k=function(){function b(b,c,d){this.request=b,this.readyState=i.ReadyStates.Done;var e=a("@reactivex/rxjs/dist/cjs/Observable.js");this.response=new e(function(a){var b=new i.Response(new i.ResponseOptions({body:c.body,status:c.statusCode}));a.next(b),a.complete()})}return b}();return b.CACHE_PRIMED_HTTP_PROVIDERS=[h.provide(i.Http,{useFactory:function(a,b,c){return new i.Http(new j(a,c),b)},deps:[i.XHRBackend,i.RequestOptions,i.ResponseOptions]})],d.define=e,c.exports}),System.registerDynamic("angular2-aspnet",["angular2-aspnet/CachePrimedHttp","angular2-aspnet/Validation"],!0,function(a,b,c){function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}var e=this,f=e.define;return e.define=void 0,d(a("angular2-aspnet/CachePrimedHttp")),d(a("angular2-aspnet/Validation")),e.define=f,c.exports}); |
@@ -38,3 +38,3 @@ var __extends = (this && this.__extends) || function (d, b) { | ||
var CacheHitConnection = (function () { | ||
function CacheHitConnection(req, responseBody, baseResponseOptions) { | ||
function CacheHitConnection(req, cachedResponse, baseResponseOptions) { | ||
this.request = req; | ||
@@ -50,3 +50,3 @@ this.readyState = http_1.ReadyStates.Done; | ||
this.response = new obsCtor(function (responseObserver) { | ||
var response = new http_1.Response(new http_1.ResponseOptions({ body: responseBody, status: 200 })); | ||
var response = new http_1.Response(new http_1.ResponseOptions({ body: cachedResponse.body, status: cachedResponse.statusCode })); | ||
responseObserver.next(response); | ||
@@ -53,0 +53,0 @@ responseObserver.complete(); |
{ | ||
"name": "angular2-aspnet", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Helpers for Angular 2 apps built on ASP.NET", | ||
@@ -5,0 +5,0 @@ "main": "./dist/Exports", |
16898