随笔分类 -  Angular

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

点击右上角即可分享
微信分享提示