Topic: mdb-autocomplete
noudard pro asked 6 years ago
<mdb-autocomplete[label]="'Select color'"initialValue="Select color"name="autocomplete"[(ngModel)]="searchStr"[datasource]="dataService"[minSearchLength]="0"> </mdb-autocomplete>
import { Component } from '@angular/core'; import { CompleterService, CompleterData } from 'ng-uikit-pro-standard'; @Component({ selector:'app-root', templateUrl:'./app.component.html', styleUrls: ['./app.component.scss'] }) export class AppComponent { title='myapp'; protectedsearchStr:string; protecteddataService:CompleterData; protectedsearchData= [ { name: 'Anthony', icon: 'https://mdbootstrap.com/img/Photos/Avatars/avatar-1.jpg' }, { name: 'Jane', icon: 'https://mdbootstrap.com/img/Photos/Avatars/avatar-2.jpg' }, { name: 'John', icon: 'https://mdbootstrap.com/img/Photos/Avatars/avatar-8.jpg' }, { name: 'Samantha', icon: 'https://mdbootstrap.com/img/Photos/Avatars/avatar-4.jpg' } ]; constructor(privatecompleterService:CompleterService) { this.dataService=completerService.local(this.searchData, 'name', 'name').imageField('icon'); } }
import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import {MDBBootstrapModulesPro } from 'ng-uikit-pro-standard'; import { AppComponent } from './app.component'; @NgModule({ declarations: [AppComponent], imports: [ BrowserModule, MDBBootstrapModulesPro.forRoot() ], providers: [], bootstrap: [AppComponent] }) export class AppModule {}
Damian Gemza staff answered 6 years ago
Damian Gemza staff answered 6 years ago
noudard pro answered 6 years ago
import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import {FormsModule } from '@angular/forms'; import {MDBBootstrapModulesPro } from 'ng-uikit-pro-standard'; import { AppComponent } from './app.component'; @NgModule({ declarations: [AppComponent], imports: [ BrowserModule, FormsModule, MDBBootstrapModulesPro.forRoot() ], providers: [], bootstrap: [AppComponent] }) export class AppModule {}
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: 6.2.3
- Device: mac
- Browser: chrome
- OS: 10.13.6
- Provided sample code: No
- Provided link: No