我是一個完整的新手到相關的JavaScript什麼,但我需要開發一個Web應用程序豐富,我努力學習Angular2與打字稿。Angular2電網錯誤
我使用角2(2.4.2版本)
我試圖使用angular2-grid插件
當我嘗試安裝它,我得到這個令人擔憂的結果:
$ npm install angular2-grid
[email protected] /home/nick/dev/angular2/first-app
├── UNMET PEER DEPENDENCY @angular/[email protected]
└── [email protected]
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN [email protected] requires a peer of @angular/[email protected] but none was installed.
如果我忽略了熱情,然後嘗試使用它,我會在瀏覽器日誌中看到以下錯誤:
Can't bind to 'ngGrid' since it isn't a known property of 'div'.
這裏是我的組件:
import { Component } from '@angular/core';
import { NgGridModule } from 'angular2-grid';
@Component({
selector: 'app-mygrid',
template: `
<h1>My First Angular 2 App</h1>
<div class="grid" [ngGrid]="{\'max_cols\': 6, \'auto_resize\': true}">
<div class="grid-item" [ngGridItem]="{\'sizex\': 2, \'sizey\': 3}">
</div>
</div>
`,
styles: []
})
export class MygridComponent implements OnInit {}
有關,當我試圖安裝angular2格警告日誌中的錯誤?它沒有安裝?我該如何解決這個問題?
我試過了,但是我得到的錯誤錯誤在NgGridModule中不是NgModule。對這個問題的反思[問題179](https://github.com/BTMorton/angular2-grid/issues/179)似乎不能解決問題 – NotBad4U