本文整理汇总了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 {
}