本文整理匯總了TypeScript中@angular/core.Injectable函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript Injectable函數的具體用法?TypeScript Injectable怎麽用?TypeScript Injectable使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Injectable函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: transform
@Injectable()
/*
Takes a value and makes it lowercase.
*/
transform(value: string, args: any[]) {
var c=Math.round(parseInt(value,10)-273.15);
var f=Math.round(parseInt(value,10)*9/5-459.67);
return `${c}°C `
}
示例2: ResourceODATAParams
export function ResourceODATAParams(params: ResourceODATAParamsBase) {
const injectable = Injectable();
const zuper = ResourceParams(params);
return function (target: Type<Resource>) {
injectable(target);
zuper(target);
target.prototype.getEntityName = function () {
if (params.name) {
return params.name;
}
return typeof params.entity === "string" ? params.entity : params.entity.name;
};
};
}
示例3: Injectable
import { Injectable, OnInit } from '@angular/core';
import { WebsocketService } from '.';
import { SocketOption } from '../model/SocketOption.model';
Injectable()
export class ProgressWebsocketService extends WebsocketService {
constructor(){
super(new SocketOption('/quartz-manager/progress', '/topic/progress'))
}
}
示例4: new
export const injectable: InjectionDecorator = <TFunction extends new (x: any, ...args: any[]) => any>(target: TFunction) => Injectable()(target);
示例5: Injectable
import { Injectable } from '@angular/core';
Injectable({
providedIn: 'root'
})
export class WsmDataService {
}