我是 angular 的新手
我使用此链接创建了新项目 https://cli.angular.io/
这里的主页显示从 appcomponent.html
我在 SRC >> pages >> index.html 和 index.ts 中创建了新页面
我将这些页面导入appcomponent.ts并appmodule.ts
如何将默认主页设置为索引。
这是我的应用组件页面
import { Component } from '@angular/core';
import { Http, Headers } from '@angular/http';
import { IndexPage } from '../pages/index';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class MyApp {
title = 'app';
rootPage:any = IndexPage;
constructor( public http: Http ) {
}
}
Run Code Online (Sandbox Code Playgroud)