本文整理汇总了TypeScript中@lib/dependency-injection/Definition.Definition.isDependencyDefined方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Definition.isDependencyDefined方法的具体用法?TypeScript Definition.isDependencyDefined怎么用?TypeScript Definition.isDependencyDefined使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@lib/dependency-injection/Definition.Definition
的用法示例。
在下文中一共展示了Definition.isDependencyDefined方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('check if an requiredDependencies value is defined', (): void => {
const d: Definition<number> = new Definition(
'add',
// tslint:disable-next-line typedef
(a, b) => {
return a + b;
}
);
expect(d.isDependencyDefined('a')).toBe(false);
d.setDependency('a', 2);
expect(d.isDependencyDefined('a')).toBe(true);
});
示例2:
definition.requiredDependencies.forEach((requiredDependency: string): void => {
if (!definition.isDependencyDefined(requiredDependency)) {
definition.setDependency(requiredDependency, this.resolve(requiredDependency));
}
});