- 博客(5)
- 资源 (1)
- 收藏
- 关注
原创 angular配置路由实现模块懒加载
import { NgModule } from '@angular/core';import { Routes, RouterModule } from '@angular/router';import { UserComponent } from './user.component';import { ProfileComponent } from './components/pro...
2019-06-30 21:39:17 754 6
原创 angular内置模块以及自定义模块
内置模块//angular内置的模块import { FormsModule } from '@angular/forms'import { HttpClientModule } from '@angular/common/http';创建自定义模块ng g module mymodule引入自定义模块app,module.ts//引入自定义模块import { UserMo...
2019-06-30 21:37:37 650 5
原创 Angular嵌套路由
1.创建组件,引入组件import { NewsaddComponent } from './components/newsadd/newsadd.component';import { NewslistComponent } from './components/newslist/newslist.component';2.配置路由{path: 'news',component:N...
2019-06-16 21:26:41 380 11
原创 【Angular】动态路由
配置动态路由const routes: Routes = [{path: 'home', component: HomeComponent},{path: 'news', component: NewsComponent},{path: 'newscontent/:id', component: NewscontentComponent},{path: '',redirectTo: ...
2019-06-09 21:10:31 523 8
原创 Angular路由
Angular路由Angular路由功能是一个纯前端解决方案,需提前对指定的(ng-app),定义路由规则,然后通过不同的URL,告诉(ng-app)加载哪个页面,再渲染到视图中。Angular的前端路由可以实现单页面的局部刷新。创建默认带路由的项目在app-routing.module.ts配置路由引入组件import { NewsComponent } from './compone...
2019-06-02 21:33:23 311 7
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人