![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
angular
文章平均质量分 59
平平无奇小码农qwq
这个作者很懒,什么都没留下…
展开
-
Angular环境搭建及创建项目
文章目录前言一、Angular环境搭建1、安装前准备工作2、使用npm/cnpm命令安装angular/cli(只需要安装一次)3、 查看是否安装成功二、创建项目前言在本地如何安装angular并且创建一个angular项目一、Angular环境搭建1、安装前准备工作1.1 安装node.js 安装教程1.2 安装npm, node自带npm,所以也不用单独安装npm1.3 安装cnpm。 (因为已经安装了npm, 所以不安装cnpm也是可以的原创 2021-01-21 16:15:22 · 592 阅读 · 0 评论 -
angular之在ts中运用管道及日期格式转换
1.引入管道import { DatePipe } from ‘@angular/common’;2.在装饰器@component中注入providers: [DatePipe];代码如下(示例):@Component({ selector: 'app-version-ui', templateUrl: './version-ui.component.html', styleUrls: ['./version-ui.component.scss'], providers: [Dat原创 2021-01-13 14:36:41 · 1699 阅读 · 1 评论 -
Angular 路由传值
目录1、get传值(‘?’ 后面拼接参数)2、动态路由传值跳转3、动态路由的JS跳转4、路由get传值的js跳转( '?' 后面拼接参数)5、两者结合传值1、get传值(‘?’ 后面拼接参数)routing中配置:const routes: Routes = [{ path: 'news', component: NewsComponent }],要传值的组件:html中跳转:<div [routerLink]="['/news']" [queryParams]="{id: '原创 2021-03-19 14:20:16 · 672 阅读 · 0 评论 -
Angular之<router-outlet>
angular默认了index.html 是整个APP的页面入口。是在angular.json文件中配置的:index.html代码如下:代码中有一段是 <app-root></app-root>这段会被app.component.html页面所替换掉<router-outlet> 是一个占位符,Angular 会根据当前的路由器状态动态填充它。<!-- app.component.html --><ul> <li&原创 2021-07-22 11:25:11 · 6065 阅读 · 0 评论