无法在 plunker 中运行 Angular 材质示例 [英] Unable run Angular material example in plunker
问题描述
我在 plunker 中使用 Angular Material 示例创建了一个示例项目.它工作正常,直到昨天今天它不工作.
I created one sample project using Angular Material example in plunker. its worked fine till yesterday today its not working.
即使是 Angular Material 示例也不起作用.你能指点我正确的方向吗.
Even Angular Material example is not working. can you please point me into right direction.
我遇到了与原始 Angular 材质 plunker 错误相同的错误.
I was getting same error as original Angular material plunker error.
Error: (SystemJS) Unexpected value 'undefined' exported by the module 'PlunkerMaterialModule'
Error: Unexpected value 'undefined' exported by the module 'PlunkerMaterialModule'
at d (https://cdnjs.cloudflare.com/ajax/libs/zone.js/0.7.2/zone.min.js:1:10303)
at syntaxError (https://unpkg.com/@angular/compiler/bundles/compiler.umd.js:1729:34)
at eval (https://unpkg.com/@angular/compiler/bundles/compiler.umd.js:15596:40)
at Array.forEach (<anonymous>)
at CompileMetadataResolver.getNgModuleMetadata (https://unpkg.com/@angular/compiler/bundles/compiler.umd.js:15594:49)
at CompileMetadataResolver.getNgModuleSummary (https://unpkg.com/@angular/compiler/bundles/compiler.umd.js:15507:52)
at eval (https://unpkg.com/@angular/compiler/bundles/compiler.umd.js:15580:72)
at Array.forEach (<anonymous>)
at CompileMetadataResolver.getNgModuleMetadata (https://unpkg.com/@angular/compiler/bundles/compiler.umd.js:15565:49)
at JitCompiler._loadModules (https://unpkg.com/@angular/compiler/bundles/compiler.umd.js:27000:70)
at JitCompiler._compileModuleAndComponents (https://unpkg.com/@angular/compiler/bundles/compiler.umd.js:26973:36)
at JitCompiler.compileModuleAsync (https://unpkg.com/@angular/compiler/bundles/compiler.umd.js:26902:37)
at PlatformRef_._bootstrapModuleWithZone (https://unpkg.com/@angular/core/bundles/core.umd.js:4568:25)
at PlatformRef_.bootstrapModule (https://unpkg.com/@angular/core/bundles/core.umd.js:4554:21)
at execute (https://run.plnkr.co/preview/cj8fyb96l00063c5srholji8p/main.ts!transpiled:108:65)
Error loading https://run.plnkr.co/preview/cj8fyb96l00063c5srholji8p/main.ts
at d (https://cdnjs.cloudflare.com/ajax/libs/zone.js/0.7.2/zone.min.js:1:10303)
at syntaxError (https://unpkg.com/@angular/compiler/bundles/compiler.umd.js:1729:34)
at eval (https://unpkg.com/@angular/compiler/bundles/compiler.umd.js:15596:40)
at Array.forEach (<anonymous>)
at CompileMetadataResolver.getNgModuleMetadata (https://unpkg.com/@angular/compiler/bundles/compiler.umd.js:15594:49)
at CompileMetadataResolver.getNgModuleSummary (https://unpkg.com/@angular/compiler/bundles/compiler.umd.js:15507:52)
at eval (https://unpkg.com/@angular/compiler/bundles/compiler.umd.js:15580:72)
at Array.forEach (<anonymous>)
at CompileMetadataResolver.getNgModuleMetadata (https://unpkg.com/@angular/compiler/bundles/compiler.umd.js:15565:49)
at JitCompiler._loadModules (https://unpkg.com/@angular/compiler/bundles/compiler.umd.js:27000:70)
at JitCompiler._compileModuleAndComponents (https://unpkg.com/@angular/compiler/bundles/compiler.umd.js:26973:36)
at JitCompiler.compileModuleAsync (https://unpkg.com/@angular/compiler/bundles/compiler.umd.js:26902:37)
at PlatformRef_._bootstrapModuleWithZone (https://unpkg.com/@angular/core/bundles/core.umd.js:4568:25)
at PlatformRef_.bootstrapModule (https://unpkg.com/@angular/core/bundles/core.umd.js:4554:21)
at execute (https://run.plnkr.co/preview/cj8fyb96l00063c5srholji8p/main.ts!transpiled:108:65)
Error loading https://run.plnkr.co/preview/cj8fyb96l00063c5srholji8p/main.ts
https://plnkr.co/edit/GKuQv2GnExGPEE3iWynF?p=previewhttps://material.angular.io/components/tabs/examples
提前致谢.
推荐答案
md
前缀已在 2.0.0-beta.11 中宣布已弃用,现在看来(2.0.0-beta.12) 它被删除.我们应该使用 mat
代替.
md
prefix was announced as deprecated in 2.0.0-beta.11 and seems now(2.0.0-beta.12) it is removed. We should use mat
instead.
所以不要导入:
MdTabsModule
和
<md-tab-group class="demo-tab-group">
<md-tab label="Tab 1">
使用
MatTabsModule
和
<mat-tab-group class="demo-tab-group">
<mat-tab label="Tab 1">
Plunker Example@2.0.0-beta.12强>
或者您可以将 angular-material version 显式设置为 @2.0.0-beta.11:
Or you can set angular-material version to @2.0.0-beta.11 explicitly:
'@angular/material': 'https://unpkg.com/@angular/material@2.0.0-beta.11/bundles/material.umd.js',
我还建议您在此处查看所有示例
I also advice you to see all examples here
这篇关于无法在 plunker 中运行 Angular 材质示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!