[英]angular 2 material card
Hi I'm very new to web development and starting off directly with angular2... Im doing some dummy web page for learning purpose but unable to implement md-card.. 嗨,我是Web开发的新手,直接从angular2开始...我正在做一些虚拟网页以供学习,但无法实现md卡。
This is my app.module.ts 这是我的app.module.ts
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import {NewComponent} from './new.component';
import {AppComponent} from './app.component';
import { HttpModule } from '@angular/http';
import {MaterialModule} from '@angular/material';
@NgModule({
imports:[BrowserModule,HttpModule,MaterialModule.forRoot()],
providers:[],
declarations:[AppComponent,NewComponent],
bootstrap:[AppComponent]
})
export class AppModule{}
in Html 在HTML中
<div *ngFor="let data of dataServer" >
<div id="myimages">
<md-card>
<img src="{{data.images.image3}}">
</md-card>
</div>
</div>
but ends up in following error 但最终出现以下错误
Error: Error: XHR error (404 Not Found) loading http://localhost:3000/@angular/material
at XMLHttpRequest.wrapFn [as _onreadystatechange] (http://localhost:3000/node_modules/zone.js/dist/zone.js:647:29)
at ZoneDelegate.invokeTask (http://localhost:3000/node_modules/zone.js/dist/zone.js:236:37)
at Zone.runTask (http://localhost:3000/node_modules/zone.js/dist/zone.js:136:47)
at XMLHttpRequest.ZoneTask.invoke (http://localhost:3000/node_modules/zone.js/dist/zone.js:304:33)
Error loading http://localhost:3000/@angular/material as "@angular/material" from http://localhost:3000/app/app.module.js
I'm not sure if i'm doing it right way.. Can somebody please provide with implementation or workaround of md-card using angualr2 typescript. 我不确定我是否使用正确的方法。有人可以使用angualr2打字稿提供md卡的实现或解决方法。 Thanks in advance 提前致谢
I'm building an app with Angular 2 Material Material card app with angular-cli 我正在使用带有angular-cli的Angular 2 Material Material卡应用程序构建一个应用程序
Note: Material card is in localhost:4200/news and if it require to login, just pass user: admin@admin.com
and password: adm9
注意:物料卡位于localhost:4200 / news中,如果需要登录,只需传递用户: admin@admin.com
和密码: adm9
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.