Angular bootstrap的一个例子
A way to initialize and launch an app or system.
In Angular, an app’s root NgModule (AppModule) has a bootstrap property that identifies the app’s top-level components.
例子:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';@NgModule({declarations: [AppComponent],imports: [BrowserModule,AppRoutingModule],providers: [],bootstrap: [AppComponent]
})
export class AppModule { }
其中bootstrap属性的值AppComponent来自文件app.component.ts:
During the bootstrap process, Angular creates and inserts these components into the index.html host web page.
index.html的内容:
<!doctype html>
<html lang="en">
<head><meta charset="utf-8"><title>MyFirstProject</title><base href="/"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body><app-root></app-root>
</body>
</html>
这个app-root的标签:
定义在app.component.ts的Component selector里:
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
Angular bootstrap的一个例子相关推荐
- Angular component的一个例子
官网:https://angular.io/guide/architecture-components Before a view is displayed, Angular evaluates th ...
- Webpack入门——使用Webpack打包Angular项目的一个例子
(一)什么是Webpack Webpack是一个前端的模块管理工具(module bundler),以下是webpack的官网:http://webpack.github.io/,一进入官网可以看到下 ...
- Angular NgTemplateOutlet的一个例子
NgTemplateOutlet:Inserts an embedded view from a prepared TemplateRef. 语法: <ng-container *ngTempl ...
- SAP Spartacus 服务器端 nodejs 应用里渲染 Angular Component 的一个例子
触发方式:将下列 url 粘贴到浏览器地址栏里,回车: http://localhost:4000/Open-Catalogue/Cameras/Hand-held-Camcorders/c/584 ...
- SAP Spartacus 中,Angular <ng-container>使用的一个例子
Angular官网里对ng-container的介绍: The Angular is a grouping element that doesn't interfere with styles or ...
- Angular 自定义 structural 指令的一个例子
The <ng-container> is a syntax element recognized by the Angular parser. It's not a directive, ...
- Phonegap集成angular/bootstrap/animate.css教程
1,phonegap集成angular 按照这篇文档的步骤:http://projectpoppycock.com/angularjs-phonegap-and-angular-seed-lets-g ...
- AngularJs angular.bind、angular.bootstrap、angular.copy
angular.bind 返回一个调用self的函数fn(self代表fn里的this).可以给fn提供参数args(*).这个功能也被称为局部操作,以区别功能. 格式:angular.bind(se ...
- TypeScript 类装饰器的一个例子和使用单步调试搞清楚其运行原理
官方文档 类装饰器的定义如下: type ClassDecorator = <TFunction extends Function>(target: TFunction) => TF ...
最新文章
- Spring源码解析 - AbstractBeanFactory 实现接口与父类分析
- LGB + KFold 代码 (1)
- 【机器学习基础】Softmax与Sigmoid你还不知道存在这些联系?
- 【Java数据库】SQL时间类型Date Time Timestamp区别、插入/取出指定时间段的数据
- scala中akka actor例子
- 3w最简单led灯电路图_Mixly 第19课 光感应灯——光敏电阻使用
- 1034 有理数四则运算 (20 分)java
- (C/C++) Link List - C++ 版本
- hibernate 高并发下遇到的大坑
- axure网页预览_解决Axure发布分享预览的3个方法
- java毕设项目——图书借阅管理系统(附源码课件)
- r语言平均值显著性检验_用R语言解读统计检验-F检验
- 串操作指令---movs,stos,rep
- Dnsmasq+ipset+iptables基于域名的流量管理
- 计算机教室云教学反思,《云》音乐教学反思
- 揭秘:一线互联网薪资曝光,看看你的价值,有没有被低估?
- Unity限制旋转角度
- java旧版下载地址_Java下载 - 最新版、历史版本的官方下载地址
- 基于JSP的员工绩效考核系统
- 鹅得了腺病毒用什么药治疗小鹅摇头晃脑不吃食怎么办