2017-10-06 90 views
1

我在plunker中使用角度材质示例创建了一个示例项目。它的工作很好,直到昨天今天它不工作。无法在plunker中运行角度材质示例

即使Angular Material示例不起作用。请你指点我正确的方向。

我得到原始的Angular材料plunker错误相同的错误。

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=preview https://material.angular.io/components/tabs/examples

在此先感谢。

回答

1

md前缀被宣布为过时的2.0.0-beta.11现在好像(2.0.0-beta.12)会被删除。我们应该使用mat

因此,而不是进口:

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 [email protected]

或者你也可以设置角材料版本@ 2.0.0 beta.11明确:

'@angular/material': 'https://unpkg.com/@angular/[email protected]/bundles/material.umd.js', 

Plunker

我也建议你看到所有的例子在这里

+0

Thx。你是一个拯救生命的人! – CharanRoot

+1

@Jonnysai以下是'2.0.0-beta.12'中的所有其他重大更改:https://github.com/angular/material2/blob/master/CHANGELOG.md#breaking-changes – Edric