我有一个示例mvc5项目,我在这个项目上成功使用了我的第一个角度2模块。现在我想在我的mvc区域内创建新的模块。所以我在我的区域解决方案中创建了一个名为app.components
的.ts
文件的新区域!像你见下文:如何在mvc5区域使用angular2?
import { Component } from '@angular/core';
@Component({
selector: 'area-app',
template:`<p>imanArea</p>`
})
export class areacomponent {<<bring below error!!!!!!!!!!!
name = 'dd';
}
装修人员的实验性支持是一种功能 是在将来的版本中改变。设置 'experimentaldecorators' 选项删除此警告
和第二个是我的根项目rootproj/app/app.module.ts
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms'; // <-- NgModel lives here
import { AppComponent } from './app.component';
***below error for this line***
import { AreaAppComponent } from './Areas/SampleArea/app/app.areacomponent'
@NgModule({
imports: [BrowserModule, FormsModule],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
找不到模块 './地区/ SampleArea /应用/ app.areacomponent'
我检查了我的路径和文件名!每一件事都是对的,但它并没有找到我的道路!
更多信息,我不得不说我的所有必要文件角在我的根项目,我的app.module
是一个命名的文件夹内应用
表示:rootProj /应用/ app.module和rootProj/app/app.component.spec
是否可以在一个项目中同时使用angular2
和mvc-Area
?我没有找到任何关于此的消息。