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

Commit c025598

Browse files
committed
Fix few directive and resource issues
1 parent 86239fa commit c025598

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

at-angular-resource.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,25 @@ module at {
1717
export class Resource implements angular.resource.IResource<Resource> {
1818
public $promise : angular.IPromise<Resource>;
1919
public $resolved : boolean;
20-
public static get(): Resource { return new Resource(); }
21-
public static query(): Resource { return new Resource(); }
22-
public static remove(): Resource { return new Resource(); }
23-
public static save(): Resource { return new Resource(); }
24-
public static delete(): Resource { return new Resource(); }
20+
public static get(params?: Object): Resource { return new Resource(); }
21+
public static query(params?: Object): Resource { return new Resource(); }
22+
public static remove(params?: Object): Resource { return new Resource(); }
23+
public static save(params?: Object): Resource { return new Resource(); }
24+
public static delete(params?: Object): Resource { return new Resource(); }
2525
constructor(model?: any) { combineResource(this, model); }
26-
public $get(): angular.IPromise<Resource> { return this.$promise; }
27-
public $query(): angular.IPromise<Resource> { return this.$promise; }
28-
public $remove(): angular.IPromise<Resource> { return this.$promise; }
29-
public $save(): angular.IPromise<Resource> { return this.$promise; }
30-
public $delete(): angular.IPromise<Resource> { return this.$promise; }
26+
public $get(params?: Object): angular.IPromise<Resource> { return this.$promise; }
27+
public $query(params?: Object): angular.IPromise<Resource> { return this.$promise; }
28+
public $remove(params?: Object): angular.IPromise<Resource> { return this.$promise; }
29+
public $save(params?: Object): angular.IPromise<Resource> { return this.$promise; }
30+
public $delete(params?: Object): angular.IPromise<Resource> { return this.$promise; }
3131
}
3232

3333
/* istanbul ignore next */
3434
export class ResourceWithUpdate extends Resource {
3535
public $promise : angular.IPromise<ResourceWithUpdate>;
3636
constructor(model?: any) { super(model); }
37-
public static update(): ResourceWithUpdate { return new ResourceWithUpdate(); }
38-
public $update(): angular.IPromise<ResourceWithUpdate> { return this.$promise; }
37+
public static update(params?: Object): ResourceWithUpdate { return new ResourceWithUpdate(); }
38+
public $update(params?: Object): angular.IPromise<ResourceWithUpdate> { return this.$promise; }
3939
}
4040

4141
export interface IResourceAnnotation {

at-angular.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ module at {
99
'controllerAs',
1010
'bindToController',
1111
'link',
12-
'name',
1312
'priority',
1413
'replace',
1514
'require',
@@ -21,7 +20,7 @@ module at {
2120
'transclude'
2221
];
2322

24-
/* tslint:disable:no-any no-console */
23+
/* tslint:disable:no-any */
2524
export interface IClassAnnotationDecorator {
2625
(target: any): void;
2726
(t: any, key: string, index: number): void;
@@ -78,9 +77,10 @@ module at {
7877
export function directive(moduleName: string, directiveName: string): at.IClassAnnotationDecorator {
7978
return (target: any): void => {
8079
let config: angular.IDirective;
80+
const ctrlName: string = angular.isString(target.controller) ? target.controller.split(' ').shift() : null;
8181
/* istanbul ignore else */
82-
if (target.controller) {
83-
controller(moduleName, target.controller.split(' ').shift())(target);
82+
if (ctrlName) {
83+
controller(moduleName, ctrlName)(target);
8484
}
8585
config = directiveProperties.reduce((
8686
config: angular.IDirective,

0 commit comments

Comments
 (0)