本文整理匯總了TypeScript中angular.Module.config方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Module.config方法的具體用法?TypeScript Module.config怎麽用?TypeScript Module.config使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類angular.Module
的用法示例。
在下文中一共展示了Module.config方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('.provider should have right return type', (done) => {
// NOTICE: Manual testing in VSCode with mouse hover
module.config(($provide: Provide) => {
// Should have type of Provider<number>
const provider0 = $provide.provider('customService0', { $get: () => 0 })
// Should have type of Provider<any>
const provider1 = $provide.provider('customService1', MyProviderFn)
// Should have type of MyProviderClass
const provider2 = $provide.provider('customService2', MyProviderClass)
// Should have type of Provider<any>
const provider3 = $provide.provider('customService3', ['$controllerProvider', MyProviderFn])
// Should have type of MyProviderClass
const provider4 = $provide.provider('customService4', ['$controllerProvider', MyProviderClass])
}).run((customService0, customService1, customService2, customService3, customService4) => {
expect(customService0).toBe(0)
expect(customService1).toBe(0)
expect(customService2).toBe(0)
expect(customService3).toBe(0)
expect(customService4).toBe(0)
done()
})
angular.bootstrap(element, ['custom'])
})