简体   繁体   English

无法在插件中运行Angular材质示例

[英]Unable run Angular material example in plunker

I created one sample project using Angular Material example in plunker. 我使用了plunker中的Angular Material示例创建了一个示例项目。 its worked fine till yesterday today its not working. 到今天为止,它的工作情况还不错,直到今天它仍然不工作。

Even Angular Material example is not working. 甚至“角材料”示例也不起作用。 can you please point me into right direction. 能给我指出正确的方向吗?

I was getting same error as original Angular material plunker error. 我遇到了与原始Angular材质插件错误相同的错误。

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 https://plnkr.co/edit/GKuQv2GnExGPEE3iWynF?p=preview https://material.angular.io/components/tabs/examples

Thanks in Advance. 提前致谢。

md prefix was announced as deprecated in 2.0.0-beta.11 and seems now( 2.0.0-beta.12 ) it is removed. md前缀在2.0.0-beta.11中宣布已弃用,现在看来( 2.0.0-beta.12 )已被删除。 We should use mat instead. 我们应该改用mat

So instead of importing: 因此,与其导入:

MdTabsModule

and

<md-tab-group class="demo-tab-group">
  <md-tab label="Tab 1">

use 采用

MatTabsModule

and

<mat-tab-group class="demo-tab-group">
  <mat-tab label="Tab 1">

Plunker Example@2.0.0-beta.12 Plunker示例@ 2.0.0-beta.12

Or you can set angular-material version to @2.0.0-beta.11 explicitly: 或者,您可以将角材料版本明确设置为@ 2.0.0-beta.11:

'@angular/material': 'https://unpkg.com/@angular/material@2.0.0-beta.11/bundles/material.umd.js',

Plunker Plunker

I also advice you to see all examples here 我也建议您在这里查看所有示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM