import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; const options = [{ value: 'zhejiang', label: 'Zhejiang', children: [{ value: 'hangzhou', label: 'Hangzhou', children: [{ value: 'xihu', label: 'West Lake', isLeaf: true }], }, { value: 'ningbo', label: 'Ningbo', isLeaf: true }], }, { value: 'jiangsu', label: 'Jiangsu', children: [{ value: 'nanjing', label: 'Nanjing', children: [{ value: 'zhonghuamen', label: 'Zhong Hua Men', isLeaf: true }], }], }]; @Component({ selector: 'cm-cascader-doc-2', templateUrl: './cascader-doc-2.component.html', styleUrls: ['./cascader-doc-2.component.css'] }) export class CascaderDoc2Component implements OnInit{ _options = options; /* _value: any[] = ['zhejiang', 'hangzhou', 'xihu']; */ /* or like this: */ _value: any[] = [{ value: 'zhejiang', label: 'Zhejiang' }, { value: 'hangzhou', label: 'Hangzhou' }, { value: 'xihu', label: 'West Lake' }]; _console(value:any) { console.log(value); } constructor() {} ngOnInit() {} }