angular5 ng-content使用方法
先自定义一个组件import { Component } from '@angular/core';@Component({ selector: 'exe-greet', template: ` <div class="border"> <p>...
【angular5项目积累总结】文件下载
download() {const token = localStorage.getItem('token');let headers: HttpHeaders = new HttpHeaders();headers = headers.set('Authorization', 'Bearer ' ...
Angular5入门与搭建项目
步骤 1. 设置开发环境在开始工作之前,你必须设置好开发环境。如果你的电脑里没有 Node.js®和 npm,请安装它们。请先在终端/控制台窗口中运行命令 node -v 和 npm -v, 来验证一下你正在运行 node 6.9.x 和 npm 3.x.x 以上的版本。 更老的版本可能会出现错误,...
Angular5学习笔记 - 创建服务(九)
一、创建服务ng generate service service-name #简写 ng g s component-nameng g s services/userService二、效果三、开发服务修改\src\app\services\user-service.service.ts文件impo...
angular5 清除定时器
ngOnDestroy 在指令被销毁前,将会调用 ngOnDestory 方法。它主要用于执行一些清理操作,比如:移除事件监听、清除定时器、退订 Observable 等。 调用方法 1. import { Component , OnInit, OnDestroy} from '@angu...
Angular5系列教程:ng-book2-angular-5-r66 土家翻译,话糙理不糙
嗯, 在工作还辣么忙之时,看了这本书,感觉很不错。想分享给国内朋友们。结合自己的理解和整理加翻译,可能有点糙,但是,话糙理不糙嘛。出系列,不知道会不会弃坑,不立Flag了。持续更新。。。。。我会放在印象笔记里,出分享链接,按章节出,章节可能当天写到哪里就是哪里,但是你看完了,不代表后面这个章节内容不...
【angular5项目积累总结】侧栏菜单 navmenu
ViewCodeimport { Component, OnInit } from '@angular/core';import { HttpClient } from '@angular/common/http';import { ConfigureService } from '../../co...
Angular5 tslint错误:The selector of the component “XXXComponent” should be used as element
错误描述 在项目中自己封装了一个 select 组件 @Component({ selector: '[app-choosen-select]', templateUrl: './selectcommon.component.html', styleUrls: ['./style....
用VSCode开发一个asp.net core 2.0+angular 5项目(4): Angular5全局错误处理
第一部分: http://www.cnblogs.com/cgzl/p/8478993.html 第二部分: http://www.cnblogs.com/cgzl/p/8481825.html 第三部分: https://www.cnblogs.com/cgzl/p/8525541.html 这篇...
Angular5学习笔记 http请求
在anular4更新到angular5后,有些模块也发生了有些变化,例如http模块。首先在app.module.ts里面引入HttpClientModuleimport { HttpClientModule } from '@angular/common/http';在组件使用的时候引入:impo...
Angular5 错误: ngModel cannot be used to register form controls with a parent formGroup directive
在创建一个表单时,出现了这样的错误: 原因是,在最外层的form中使用了 formGroup 指令,但在下面的某个input 插件中,使用了ngModel 指令,但没有加入formControl 指令或 formControlName 属性。 1 <form [formGrou...
angular5学习笔记(deep in 路由)
最近接手了一个angular5的项目。项目本身是由不同的人开发的,所有代码结构风格本身就有很大不同,加上本身接触angular5也不久,之前都是使用1,所有自身压力还是很大的。接手前几天当然是熟悉代码了。其中就有用到路由的几个延伸功能,比如子路由,路由延迟加载。子路由children:话不多说,先上...
Angular5学习笔记 - 配置Http(七)
一、引入Http模块编辑\src\app\app.module.ts文件import { HttpModule } from '@angular/http'; /* 注册模块 */ imports: [ HttpModule, ],二、编辑列表画面编辑\src\app\component...
angular5 directive和component的区别
指令分为三类,组件,属性指令和结构性指令 组件(Component directive):UI组件,继承于Directive; 属性指令(Attribute directive):改变组件的样式; 结构指令(Structural directive):改变DOM布局; 属性指令例如 ng...
Angular5 错误: ngModel cannot be used to register form controls with a parent formGroup directive
在创建一个表单时,出现了这样的错误: 原因是,在最外层的form中使用了 formGroup 指令,但在下面的某个input 插件中,使用了ngModel 指令,但没有加入formControl 指令或 formControlName 属性。 1 <form [formGrou...
【angular5项目积累总结】breadcrumb面包屑组件
viewcode<div class="fxs-breadcrumb-wrapper" aria-label="Navigation history"> <div class="fxs-breadcrumb-dropmenu"> <div class...
angular5与angular6的比较
Angular5初探之--构建一个简单的单页应用,包含登录(login)和几个一级菜单
1、项目目录结构为:@angular/cli标准目录结构,截图如下: 2、src开发文件夹已经上传至github,需要的朋友可以参考 : https://github.com/chuanzaizai/Angular5_demo 3、使用@angular/cli快速构建项目...