小编Phi*_*ipp的帖子

新建angular项目如何设置主页

我是 angular 的新手

我使用此链接创建了新项目 https://cli.angular.io/

这里的主页显示从 appcomponent.html

我在 SRC >> pages >> index.html 和 index.ts 中创建了新页面

我将这些页面导入appcomponent.tsappmodule.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)

html typescript angular

3
推荐指数
1
解决办法
2万
查看次数

标签 统计

angular ×1

html ×1

typescript ×1