Asp.net 在angular 2和asp mvc中找不到该页
我在asp mvc 5中使用了angular 2 当我使用此代码时,它工作正常,没有问题 app.module:Asp.net 在angular 2和asp mvc中找不到该页,asp.net,asp.net-mvc,angular,angular2-routing,angular2-template,Asp.net,Asp.net Mvc,Angular,Angular2 Routing,Angular2 Template,我在asp mvc 5中使用了angular 2 当我使用此代码时,它工作正常,没有问题 app.module: import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; @NgModule({ imports: [BrowserModule
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
@NgModule({
imports: [BrowserModule],
declarations: [AppComponent],
bootstrap: [AppComponent]
})
export class AppModule { }
应用程序组件:
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: '<h1>My First App</h1>'
})
export class AppComponent {
}
应用程序组件:
import { Component } from '@angular/core';
import { OtherComponent } from './other/other.component';
@Component({
selector: 'my-app',
template: `<h1>My First App</h1>
<other-app></other-app>
`
})
export class AppComponent {
}
import { Component , OnInit } from '@angular/core';
@Component({
selector: 'other-app',
templateUrl: 'app/other/other.component'
})
export class OtherComponent implements OnInit {
Constractor() { }
ngOnInit(){ }
}
other.component.html:
<div class="panel panel-default">
<div class="panel-body">
{{name}}
</div>
</div>
{{name}}
有什么问题?如何解决此问题?
templateUrl:'app/other/other.component'中的add.html格式
'app/other/other.component.html'
<div class="panel panel-default">
<div class="panel-body">
{{name}}
</div>
</div>
'app/other/other.component.html'