Angular Material Autocomplete input textbox – md-autocomplete example

Angular Material Autocomplete input textbox – md-autocomplete example

In this Post We Will Explain About is Angular Material Autocomplete input textbox – md-autocomplete example With Example and Demo.Welcome on infinityknow.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to md-autocompleteExample

In this post we will show you Best way to implement angular2 material autocomplete template Example, hear for angular-material-autocomplete-listwith Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Angular Material Dependencies

<a href="http://angular.min.js">http://angular.min.js</a>
<a href="http://angular-animate.min.js">http://angular-animate.min.js</a>
<a href="http://angular-aria.min.js">http://angular-aria.min.js</a>
<a href="http://angular-messages.min.js">http://angular-messages.min.js</a>
<a href="http://angular-material.min.js">http://angular-material.min.js</a>

index.html

<div>
    <div>
        
            <strong>To reproduce:</strong>
            <ul>
                <li>Type "infinityknow.com" into the search box</li>
                <li>Before the list is populated with "infinityknow.com", "No matches found" will briefly simple flash</li>
            </ul>
        

        
            
                
                    <span>{{item.langcode}} - </span>
                    <span>{{item.lan_name}}</span>
                
                
                    No ANY matches found BY infinityknow.com Autocomplete BOX
                
            
        
    </div>
</div>

scripts(index.js)

angular
    .module('liveAutocompleteApp', ['ngMaterial'])
    .controller('liveCtrl', function($scope, $q, $timeout) {
        this.getMatches = function(liveText) {
            var deferred = $q.defer();

            $timeout(function() {
                var language = getlangname().filter(function(state) {
                    return (state.lan_name.toUpperCase().indexOf(liveText.toUpperCase()) !== -1 || state.langcode.toUpperCase().indexOf(liveText.toUpperCase()) !== -1);
                });
                deferred.resolve(language);
            }, 1500);

            return deferred.promise;
        }
    });


function getlangname() {
    return [{
        "lan_name": "Laravel",
        "langcode": "AL"
    }, {
        "lan_name": "PHP",
        "langcode": "AK"
    }, {
        "lan_name": "Vuejs Samoa",
        "langcode": "AS"
    }, {
        "lan_name": "codignator",
        "langcode": "AZ"
    }, {
        "lan_name": "Magento",
        "langcode": "AR"
    }, {
        "lan_name": "mysql",
        "langcode": "CA"
    }, {
        "lan_name": "mysqli",
        "langcode": "CO"
    }, {
        "lan_name": "javascript",
        "langcode": "CT"
    }, {
        "lan_name": "jquery",
        "langcode": "DE"
    }, {
        "lan_name": "Asp.net",
        "langcode": "DC"
    }, {
        "lan_name": "laravel API",
        "langcode": "FM"
    }, {
        "lan_name": "wordpress",
        "langcode": "FL"
    }, {
        "lan_name": "HTML",
        "langcode": "GA"
    }, {
        "lan_name": "CSS",
        "langcode": "GU"
    }, {
        "lan_name": "gujrati",
        "langcode": "HI"
    }, {
        "lan_name": "hindi",
        "langcode": "ID"
    }, {
        "lan_name": "mathematics",
        "langcode": "IL"
    }, {
        "lan_name": "science",
        "langcode": "IN"
    }, {
        "lan_name": "yii",
        "langcode": "IA"
    }, {
        "lan_name": "rectjs",
        "langcode": "KS"
    }, {
        "lan_name": "meanjs",
        "langcode": "KY"
    }, {
        "lan_name": "examples",
        "langcode": "LA"
    }, {
        "lan_name": "math",
        "langcode": "ME"
    }, {
        "lan_name": "sunscrit",
        "langcode": "MH"
    }, {
        "lan_name": "malae",
        "langcode": "MD"
    }, {
        "lan_name": "india",
        "langcode": "MA"
    }, {
        "lan_name": "data",
        "langcode": "MI"
    }, {
        "lan_name": "laraphp",
        "langcode": "MN"
    }, {
        "lan_name": "okkkkkk",
        "langcode": "MS"
    }, {
        "lan_name": "simple examples",
        "langcode": "MO"
    }, {
        "lan_name": "free languages",
        "langcode": "MT"
    }, {
        "lan_name": "examples",
        "langcode": "NE"
    }, {
        "lan_name": "free download",
        "langcode": "NV"
    }, {
        "lan_name": "live24 free",
        "langcode": "NH"
    }, {
        "lan_name": "live24 download",
        "langcode": "NJ"
    }, {
        "lan_name": "live24 https",
        "langcode": "NM"
    }, {
        "lan_name": "live24 ssl",
        "langcode": "NY"
    }, {
        "lan_name": "latest simple",
        "langcode": "NC"
    }, {
        "lan_name": "javaa Dakota",
        "langcode": "ND"
    }, {
        "lan_name": "mpds mbbs Islands",
        "langcode": "MP"
    }, {
        "lan_name": "LMW",
        "langcode": "OH"
    }, {
        "lan_name": "HKG",
        "langcode": "OK"
    }, {
        "lan_name": "BED",
        "langcode": "OR"
    }, {
        "lan_name": "MCA",
        "langcode": "PW"
    }, {
        "lan_name": "BA",
        "langcode": "PA"
    }, {
        "lan_name": "Account",
        "langcode": "PR"
    }, {
        "lan_name": "sp",
        "langcode": "RI"
    }, {
        "lan_name": "laravel++",
        "langcode": "SC"
    }, {
        "lan_name": "c++",
        "langcode": "SD"
    }, {
        "lan_name": "c",
        "langcode": "TN"
    }, {
        "lan_name": "css",
        "langcode": "TX"
    }, {
        "lan_name": "java",
        "langcode": "UT"
    }, {
        "lan_name": "facebook",
        "langcode": "VT"
    }, {
        "lan_name": "skype",
        "langcode": "VI"
    }, {
        "lan_name": "filezilla",
        "langcode": "VA"
    }, {
        "lan_name": "lampp",
        "langcode": "WA"
    }, {
        "lan_name": "wamapp",
        "langcode": "WV"
    }, {
        "lan_name": "xampp",
        "langcode": "WI"
    }, {
        "lan_name": "notepad",
        "langcode": "WY"
    }];
}

Include Css

html,
body {
    background: #DBEAF9;
}

Example

READ :  Vue SEO Tutorial Guide for Beginners

I hope you have Got What is AngularJS Material Design Autocomplete Examples And how it works.I would Like to have FeadBack From My Blog(infinityknow.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(infinityknow.com) Are Most Always Welcome.

Add a Comment

Your email address will not be published. Required fields are marked *