I want to use angularjs and typescript together. I am trying to create Orm factoryusing typescript and style with some problem.
I defined the factory class as follows:
class OrmModel implements IOrmModel {
static $inject = ['$http', '$q', 'config'];
private name:string;
private isNewRecord:boolean = false;
constructor(public $http:ng.IHttpService, private $q:ng.IQService, private config:Object) {
}
static findAll(params:ISearchParams, relations:string[]):ng.IPromise<OrmModel> {
}
}
Here I defined a factory.
OrmModule:ng.IModel = angular.module('core.orm', []);
OrmModule.factory('OrmModel', ['$http', '$q', OrmModel]);
How to use the method $httpor $qin findAll()?
source
share