本文整理汇总了TypeScript中@angular/core/src/di/reflective_key.KeyRegistry类的典型用法代码示例。如果您正苦于以下问题:TypeScript KeyRegistry类的具体用法?TypeScript KeyRegistry怎么用?TypeScript KeyRegistry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了KeyRegistry类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: describe
describe("key", function() {
var registry: KeyRegistry;
beforeEach(function() { registry = new KeyRegistry(); });
it('should be equal to another key if type is the same',
function() { expect(registry.get('car')).toBe(registry.get('car')); });
it('should not be equal to another key if types are different',
function() { expect(registry.get('car')).not.toBe(registry.get('porsche')); });
it('should return the passed in key',
function() { expect(registry.get(registry.get('car'))).toBe(registry.get('car')); });
});
示例2: function
function() { expect(registry.get(registry.get('car'))).toBe(registry.get('car')); });