本文整理匯總了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')); });