Showing
5 changed files
with
3 additions
and
58 deletions
| 1 | import { Http } from '@angular/http'; | 1 | import { Http } from '@angular/http'; |
| 2 | -import { ModuleWithProviders } from '@angular/core'; | ||
| 3 | import { Rest } from './services/rest'; | 2 | import { Rest } from './services/rest'; |
| 4 | import { Repository } from './services/repository'; | 3 | import { Repository } from './services/repository'; |
| 5 | export { Rest } from './services/rest'; | 4 | export { Rest } from './services/rest'; |
| ... | @@ -7,6 +6,3 @@ export { Repository } from './services/repository'; | ... | @@ -7,6 +6,3 @@ export { Repository } from './services/repository'; |
| 7 | export { Device } from './services/device'; | 6 | export { Device } from './services/device'; |
| 8 | export declare function provideRest(http: Http): Rest; | 7 | export declare function provideRest(http: Http): Rest; |
| 9 | export declare function provideRepository(rest: Rest): Repository; | 8 | export declare function provideRepository(rest: Rest): Repository; |
| 10 | -export declare class DigsigServicesModule { | ||
| 11 | - static forRoot(): ModuleWithProviders; | ||
| 12 | -} | ... | ... |
| 1 | "use strict"; | 1 | "use strict"; |
| 2 | -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
| 3 | - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
| 4 | - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
| 5 | - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
| 6 | - return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
| 7 | -}; | ||
| 8 | Object.defineProperty(exports, "__esModule", { value: true }); | 2 | Object.defineProperty(exports, "__esModule", { value: true }); |
| 9 | -var http_1 = require("@angular/http"); | ||
| 10 | -var core_1 = require("@angular/core"); | ||
| 11 | var rest_1 = require("./services/rest"); | 3 | var rest_1 = require("./services/rest"); |
| 12 | var repository_1 = require("./services/repository"); | 4 | var repository_1 = require("./services/repository"); |
| 13 | var device_1 = require("./services/device"); | 5 | var device_1 = require("./services/device"); |
| ... | @@ -25,27 +17,4 @@ function provideRepository(rest) { | ... | @@ -25,27 +17,4 @@ function provideRepository(rest) { |
| 25 | return new repository_1.Repository(rest, new device_1.Device); | 17 | return new repository_1.Repository(rest, new device_1.Device); |
| 26 | } | 18 | } |
| 27 | exports.provideRepository = provideRepository; | 19 | exports.provideRepository = provideRepository; |
| 28 | -var DigsigServicesModule = DigsigServicesModule_1 = (function () { | ||
| 29 | - function DigsigServicesModule() { | ||
| 30 | - } | ||
| 31 | - DigsigServicesModule.forRoot = function () { | ||
| 32 | - return { | ||
| 33 | - ngModule: DigsigServicesModule_1, | ||
| 34 | - providers: [ | ||
| 35 | - { provide: rest_1.Rest, useFactory: provideRest, deps: [http_1.Http] }, | ||
| 36 | - { provide: repository_1.Repository, useFactory: provideRepository, deps: [rest_1.Rest] } | ||
| 37 | - ] | ||
| 38 | - }; | ||
| 39 | - }; | ||
| 40 | - return DigsigServicesModule; | ||
| 41 | -}()); | ||
| 42 | -DigsigServicesModule = DigsigServicesModule_1 = __decorate([ | ||
| 43 | - core_1.NgModule({ | ||
| 44 | - imports: [ | ||
| 45 | - http_1.HttpModule | ||
| 46 | - ] | ||
| 47 | - }) | ||
| 48 | -], DigsigServicesModule); | ||
| 49 | -exports.DigsigServicesModule = DigsigServicesModule; | ||
| 50 | -var DigsigServicesModule_1; | ||
| 51 | //# sourceMappingURL=index.js.map | 20 | //# sourceMappingURL=index.js.map |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,sCAAiD;AACjD,sCAA8D;AAC9D,wCAAuC;AACvC,oDAAmD;AACnD,4CAA2C;AAE3C,wCAAuC;AAA9B,sBAAA,IAAI,CAAA;AACb,oDAAmD;AAA1C,kCAAA,UAAU,CAAA;AACnB,4CAA2C;AAAlC,0BAAA,MAAM,CAAA;AAEf,qBAA4B,IAAS;IACjC,MAAM,CAAC,IAAI,WAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAFD,kCAEC;AAED,2BAAkC,IAAS;IACvC,MAAM,CAAC,IAAI,uBAAU,CAAC,IAAI,EAAE,IAAI,eAAM,CAAC,CAAC;AAC5C,CAAC;AAFD,8CAEC;AAOD,IAAa,oBAAoB;IAAjC;IAUA,CAAC;IATQ,4BAAO,GAAd;QACE,MAAM,CAAC;YACL,QAAQ,EAAE,sBAAoB;YAC9B,SAAS,EAAE;gBACT,EAAE,OAAO,EAAE,WAAI,EAAE,UAAU,EAAC,WAAW,EAAE,IAAI,EAAC,CAAC,WAAI,CAAC,EAAE;gBACtD,EAAE,OAAO,EAAE,uBAAU,EAAE,UAAU,EAAC,iBAAiB,EAAE,IAAI,EAAC,CAAC,WAAI,CAAC,EAAE;aACnE;SACF,CAAA;IACH,CAAC;IACH,2BAAC;AAAD,CAAC,AAVD,IAUC;AAVY,oBAAoB;IALhC,eAAQ,CAAC;QACN,OAAO,EAAG;YACN,iBAAU;SACb;KACJ,CAAC;GACW,oBAAoB,CAUhC;AAVY,oDAAoB"} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AACA,wCAAuC;AACvC,oDAAmD;AACnD,4CAA2C;AAE3C,wCAAuC;AAA9B,sBAAA,IAAI,CAAA;AACb,oDAAmD;AAA1C,kCAAA,UAAU,CAAA;AACnB,4CAA2C;AAAlC,0BAAA,MAAM,CAAA;AAEf,qBAA4B,IAAS;IACjC,MAAM,CAAC,IAAI,WAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAFD,kCAEC;AAED,2BAAkC,IAAS;IACvC,MAAM,CAAC,IAAI,uBAAU,CAAC,IAAI,EAAE,IAAI,eAAM,CAAC,CAAC;AAC5C,CAAC;AAFD,8CAEC"} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -15,9 +15,9 @@ | ... | @@ -15,9 +15,9 @@ |
| 15 | "author": "", | 15 | "author": "", |
| 16 | "license": "ISC", | 16 | "license": "ISC", |
| 17 | "devDependencies": { | 17 | "devDependencies": { |
| 18 | - "@angular/common": "4.1.0", | ||
| 19 | "@angular/core": "4.1.0", | 18 | "@angular/core": "4.1.0", |
| 20 | "@angular/http": "4.1.0", | 19 | "@angular/http": "4.1.0", |
| 20 | + "@angular/common": "4.1.0", | ||
| 21 | "@angular/platform-browser": "4.1.0", | 21 | "@angular/platform-browser": "4.1.0", |
| 22 | "@types/jasmine": "^2.5.43", | 22 | "@types/jasmine": "^2.5.43", |
| 23 | "jasmine": "^2.5.3", | 23 | "jasmine": "^2.5.3", |
| ... | @@ -30,7 +30,6 @@ | ... | @@ -30,7 +30,6 @@ |
| 30 | "zone.js": "^0.8.4" | 30 | "zone.js": "^0.8.4" |
| 31 | }, | 31 | }, |
| 32 | "peerDependencies": { | 32 | "peerDependencies": { |
| 33 | - "@angular/core": "*", | ||
| 34 | "@angular/http": "*", | 33 | "@angular/http": "*", |
| 35 | "rxjs": "*", | 34 | "rxjs": "*", |
| 36 | "pouchdb": "*", | 35 | "pouchdb": "*", | ... | ... |
| 1 | -import { HttpModule, Http } from '@angular/http'; | 1 | +import { Http } from '@angular/http'; |
| 2 | -import { NgModule, ModuleWithProviders } from '@angular/core'; | ||
| 3 | import { Rest } from './services/rest'; | 2 | import { Rest } from './services/rest'; |
| 4 | import { Repository } from './services/repository'; | 3 | import { Repository } from './services/repository'; |
| 5 | import { Device } from './services/device'; | 4 | import { Device } from './services/device'; |
| ... | @@ -15,21 +14,3 @@ export function provideRest(http:Http) : Rest { | ... | @@ -15,21 +14,3 @@ export function provideRest(http:Http) : Rest { |
| 15 | export function provideRepository(rest:Rest) : Repository { | 14 | export function provideRepository(rest:Rest) : Repository { |
| 16 | return new Repository(rest, new Device); | 15 | return new Repository(rest, new Device); |
| 17 | } | 16 | } |
| 18 | - | ||
| 19 | -@NgModule({ | ||
| 20 | - imports : [ | ||
| 21 | - HttpModule | ||
| 22 | - ] | ||
| 23 | -}) | ||
| 24 | -export class DigsigServicesModule { | ||
| 25 | - static forRoot(): ModuleWithProviders { | ||
| 26 | - return { | ||
| 27 | - ngModule: DigsigServicesModule, | ||
| 28 | - providers: [ | ||
| 29 | - { provide: Rest, useFactory:provideRest, deps:[Http] } , | ||
| 30 | - { provide: Repository, useFactory:provideRepository, deps:[Rest] } | ||
| 31 | - ] | ||
| 32 | - } | ||
| 33 | - } | ||
| 34 | -} | ||
| 35 | - | ... | ... |
-
Please register or login to post a comment