大佬教程收集整理的这篇文章主要介绍了在Angular5问题中的ng-select:ERROR TypeError:Object(…)不是NgDropdownPanelComponent.ngOnInit(ng-select.js)中的函数,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
ERROR TypeError: Object(...) is not a function at NgDropdownPanelComponent.ngOnInit (ng-SELEct.js:1450) at checkAndupdateDirectiveInline (core.js:12352) at checkAndupdateNodeInline (core.js:13876)
而且我也不能选择我想要的信息(在这种情况下属性’nom’),就像ng SELEct被阻止或者像这样的东西.
<ng-SELEct *ngIf="_listClients" [items]="listClient" bindLabel ="nom" bindValue ="id" [(ngModel)]="SELEctedPersonId"> </ng-SELEct> <p> SELEcted city ID: {{SELEctedPersonId | json}} </p>
import {Component,OnInit,ViewChilD} from '@angular/core'; import {ActivatedRoute,Router} from '@angular/router'; import {ProjetservicE} from '../../../../../service/projet.service'; import {Projet} from '../../Models/Projet'; import { ModalDirective } from 'ngx-bootstrap/modal'; import 'rxjs/add/operator/map'; import {ClientservicE} from '../../../../../service/client.service'; @Component({ SELEctor: 'app-projects',templateUrl: './projects.component.html',styleUrls: ['./projects.component.scss'] }) export class ProjectsComponent implements OnInit { SELEctedPersonId:number = null; _listClients :any; constructor(private router:router,private projetSevice:Projetservice,private clientServ:Clientservice,private route: ActivatedRoutE) { } ngOnInit() { this.CLIENtList(); } get listClient() { return this._listClients ? this._listClients.map(item => { return {id: item.id,prenom : item.prenom,nom : item.nom} }) : []; } clientList(){ this.CLIENtServ.getListClients() .subscribe((data:any)=>{ this._listClients=data; },err=>{ console.log('this is error '); }) } }
有帮助吗?
我认为,ng-SELEct v2.0.0有这个问题.我在GitHub回购中找到了2个问题请求.
解决方法:
尝试将版本降级到v1.4.1.
npm uninstall @ng-SELEct/ng-SELEct npm i -s @ng-SELEct/ng-SELEct@1.4.1
编辑:(25.05.18)
有问题是从Rxjs 6.0中断更改.如果您正在使用Angular v5 install ng-SELEct v1.x或使用rxjs-compat安装ng-SELEct v2.0.
npm i -s @ng-SELEct/ng-SELEct@1.x //or npm i -s @ng-SELEct/ng-SELEct@latest rxjs-compat
以上是大佬教程为你收集整理的在Angular5问题中的ng-select:ERROR TypeError:Object(…)不是NgDropdownPanelComponent.ngOnInit(ng-select.js)中的函数全部内容,希望文章能够帮你解决在Angular5问题中的ng-select:ERROR TypeError:Object(…)不是NgDropdownPanelComponent.ngOnInit(ng-select.js)中的函数所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。