mo-cascader-city
v0.0.3
Published
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.3.0.
Downloads
2
Readme
MoCascaderCity
This library was generated with Angular CLI version 13.3.0.
安装
npm i -S mo-cascader-city -registry https://registry.npmjs.org
修改 startup.service.ts,添加接口地址
import { MoCascaderCityService } from 'mo-cascader-city';
constructor(moCascaderCitysrv: MoCascaderCityService) {
moCascaderCitysrv.setUrl(`省接口地址`, `市区接口地址`);
}
添加 MoCascaderCityModule
import { MoCascaderCityModule } from 'mo-cascader-city';
使用
<mo-cascader-city formControlName="codes" (moOnChange)="addressChange($event)"></mo-cascader-city>
addressChange(e: any){
console.log(e);
/* 打印结果
{
provinceCode: '',
provinceName: '',
cityCode: '',
cityName: '',
districtCode: '',
districtName: ''
}
*/
}