随笔分类 - Angular
摘要:https://www.cnblogs.com/Roy_Zhou/articles/15306314.html
阅读全文
摘要:import { StorageService } from '../service/storage.service'; @Component({ selector: 'app-cpmone', templateUrl: './cpmone.component.html', styleUrls: [
阅读全文
摘要:1. ng g module weekly-info/staff-weekly --routing 2. ng g c weekly-info/staff-weekly
阅读全文
摘要:// 使用如下方法进行深拷贝,但此方法有缺点,请自行查阅。 let obj2 = JSON.parse(JSON.stringify(obj1));
阅读全文
摘要:重点 重点 重点: 给每个input添加id属性。
阅读全文
摘要:方法一:使用高德api转化 var gps = [116.3, 39.9]; AMap.convertFrom(gps, 'gps', function (status, result) { if (result.info 'ok') { var lnglats = result.locations
阅读全文
摘要:import { Component, OnInit } from '@angular/core'; import { NzMessageService } from 'ng-zorro-antd/message'; import { MapService } from './map.service
阅读全文
摘要:1. 创建公共服务 一般在公共文件内创建公共服务,命令:ng g s 路径\服务名称如: ng g s service\storage。得到 storage.service.ts,实现内容如下: import { Injectable } from '@angular/core'; // 1. 引入
阅读全文
摘要:// 父子间HTML文件在使用子组件时,用 # 标识 <app-company-add-edit #CompanyAddEditComponent></app-company-add-edit> // 父组件TS文件: // 1. 引入子组件 和 ViewChild import { Company
阅读全文
摘要:方式一(不推荐,容易产生循环依赖): 在子组件的TS文件中 import 引入父组件,并在 constructor 注册。 通过this.子组件别名.方法名(),即可调用 // 步骤1 import { ExternalPersonManageComponent } from '../externa
阅读全文
摘要:Angular脚手架中的命令 创建项目:ng new projectName 启动项目:ng serve --open 创建组件:ng g c 目录/componentName 创建模块:ng g m 目录/moduleName 创建服务:ng g s 目录/serveName 1. Angular
阅读全文