Skip to content
This repository was archived by the owner on Aug 18, 2018. It is now read-only.

Commit 20dc56f

Browse files
committed
IService interface added. No more IResource for injected resources
1 parent 88c52d1 commit 20dc56f

12 files changed

Lines changed: 25 additions & 22 deletions

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ts-angular-jsonapi",
3-
"version": "0.3.33",
3+
"version": "0.4.2",
44
"description": "JSONAPI library developed for AngularJS in Typescript",
55
"repository": {
66
"type": "git",

src/demo/authors/author.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ class AuthorController {
77

88
/** @ngInject */
99
constructor(
10-
protected AuthorsService: Jsonapi.IResource,
11-
protected BooksService: Jsonapi.IResource,
10+
protected AuthorsService: Jsonapi.IService,
11+
protected BooksService: Jsonapi.IService,
1212
protected $stateParams
1313
) {
1414
this.author = AuthorsService.get(

src/demo/authors/authors.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class AuthorsController {
66
/** @ngInject */
77
constructor(
88
protected JsonapiCore,
9-
protected AuthorsService: Jsonapi.IResource
9+
protected AuthorsService: Jsonapi.IService
1010
) {
1111
this.authors = AuthorsService.all(
1212
// { include: ['books', 'photos'] },

src/demo/books/book.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export class BookController {
55

66
/** @ngInject */
77
constructor(
8-
protected BooksService: Jsonapi.IResource,
8+
protected BooksService: Jsonapi.IService,
99
protected $stateParams
1010
) {
1111
this.book = BooksService.get(

src/demo/books/books.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class BooksController {
55

66
/** @ngInject */
77
constructor(
8-
protected BooksService: Jsonapi.IResource,
8+
protected BooksService: Jsonapi.IService,
99
protected $stateParams
1010
) {
1111

src/demo/photos/photos.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class PhotosController {
55

66
/** @ngInject */
77
constructor(
8-
protected PhotosService: Jsonapi.IResource
8+
protected PhotosService: Jsonapi.IService
99
) {
1010
// if you check your console, library make only one request
1111
this.makeRequest(1);

src/demo/tests/noduplicatedhttpcalls.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class NoDuplicatedHttpCallsComponent {
66
/** @ngInject */
77
constructor(
88
protected JsonapiCore,
9-
protected AuthorsService: Jsonapi.IResource
9+
protected AuthorsService: Jsonapi.IService
1010
) {
1111
for (let i = 1; i <= 3; i++) {
1212
this.authors[i] = AuthorsService.all(

src/library/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515

1616
// TS-Jsonapi Classes Interfaces
1717
// / <reference path="./interfaces/core.d.ts"/>
18+
/// <reference path="./interfaces/service.d.ts"/>
1819
/// <reference path="./interfaces/collection.d.ts"/>
1920
/// <reference path="./interfaces/resource.d.ts"/>

src/library/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,6 @@ export { Core };
3434
export { Resource };
3535
export * from './interfaces';
3636
import { IResource } from './interfaces';
37+
import { IService } from './interfaces';
3738
export { IResource };
39+
export { IService };

src/library/interfaces/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// export { ICollection } from 'collection.d'
21
export * from './core.d'
32
export * from './collection.d'
43
export * from './schema.d'
4+
export * from './service.d'
55
export * from './resource.d'
66
export * from './cache.d'
77
export * from './params-collection.d'

0 commit comments

Comments
 (0)