本文整理匯總了TypeScript中@angular-devkit/core.fragment函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript fragment函數的具體用法?TypeScript fragment怎麽用?TypeScript fragment使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了fragment函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('can list', () => {
const host = new SyncDelegateHost(new SimpleMemoryHost());
const buffer = stringToFileBuffer('hello');
host.write(normalize('/sub/file1'), buffer);
host.write(normalize('/sub/file2'), buffer);
host.write(normalize('/sub/sub1/file3'), buffer);
host.write(normalize('/file4'), buffer);
expect(host.list(normalize('/sub')))
.toEqual([fragment('file1'), fragment('file2'), fragment('sub1')]);
expect(host.list(normalize('/')))
.toEqual([fragment('sub'), fragment('file4')]);
expect(host.list(normalize('/inexistent'))).toEqual([]);
});
示例2: fragment
obs.next(names.map(name => fragment(name)));
示例3: generateRoutingModuleFileName
export function generateRoutingModuleFileName(moduleName: string): PathFragment {
return fragment(strings.dasherize(moduleName) + ROUTING_MODULE_EXT);
}
示例4: generateFeatureModuleFileName
export function generateFeatureModuleFileName(moduleName: string): PathFragment {
return fragment(strings.dasherize(moduleName) + FEATURE_MODULE_EXT);
}