TechQA.

md-autocomplete with bootstrap's class="modal-content" not working

421 views Asked by Vishal Arthamwar At 2017-08-29T09:17:26+00:00 29 August 2017 at 09:17 2025-12-22T10:30:35+00:00

My Main Modal Component is:-

<div class="modal-content">
    <div class="modal-header"> </div>
    <div class="modal-body">
        <display-states-component rolesdata="$ctrl.modaldata.displayStatesRoles"></display-states-component>
    </div>
</div>

DisplayStatesComponent is(Angular 1.5 Component architecture)

<form ng-submit="$event.preventDefault()">
    <md-autocomplete md-no-cache="true" md-selected-item="$ctrl.displayPerRoles[$index].roleName" md-search-text="$ctrl.searchText" md-items="item in $ctrl.querySearch($ctrl.searchText)" md-item-text="item.value" md-min-length="0" placeholder="Select Role?">
        <md-item-template>
            <span md-highlight-text="$ctrl.searchText" md-highlight-flags="^i">{{item.value}}</span>{{item.value}}
        </md-item-template>
        <md-not-found>
            No role matching "{{$ctrl.searchText}}" were found.
            <a ng-click="$ctrl.manageStates('ADD')">Create a new one!</a>
        </md-not-found>
    </md-autocomplete>
</form>

And MY Corresponding Display States Controller is:-

 $ctrl.states = loadAll();

 $ctrl.querySearch = function(query) {
     var results = query ? $ctrl.states.filter(createFilterFor(query)) : $ctrl.states,
         deferred;
     console.log("With my Testings in else--->", results);
     return results;
 }

 /**
  * Build `states` list of key/value pairs
  */
 function loadAll() {
     var allStates = 'Alabama, Alaska, Arizona, Arkansas, California, Colorado, Connecticut, Delaware,\
              Florida, Georgia, Hawaii, Idaho, Illinois, Indiana, Iowa, Kansas, Kentucky, Louisiana,\
              Maine, Maryland, Massachusetts, Michigan, Minnesota, Mississippi, Missouri, Montana,\
              Nebraska, Nevada, New Hampshire, New Jersey, New Mexico, New York, North Carolina,\
              North Dakota, Ohio, Oklahoma, Oregon, Pennsylvania, Rhode Island, South Carolina,\
              South Dakota, Tennessee, Texas, Utah, Vermont, Virginia, Washington, West Virginia,\
              Wisconsin, Wyoming';

     return allStates.split(/, +/g).map(function(state) {
         return {
             value: state.toLowerCase(),
             display: state
         };
     });
 }

My Filter Functions are

function createFilterFor(query) {
    var lowercaseQuery = angular.lowercase(query);

    return function filterFn(state) {
        return (state.value.indexOf(lowercaseQuery) === 0);
    }
};

I am using this code to search for states as the user types state name in autocomplete box. I am getting the results on console but that is not showing item text (I think getting hidden behind bootsrap's modal).

Thanks in advance.

angularjs bootstrap-modal md-autocomplete
Original Q&A
0

There are 0 answers

Related Questions in ANGULARJS

  • How to automatically change path in angular when scrolling
  • Error two clicks to be able to login Angular 16
  • Passing an array of objects through the $http.post method in angular JS does not work
  • Understanding how to apply Angular Signals from beginning on an existing service
  • provider duplicate while compiling a Cordova application for the Android platform
  • How can I use angularjs $parse service in Angular?
  • Width of custom headers in ag-grid (angular) doesn't match with column's width
  • Issues with Katex/ngx-markdown Rendering in Angular 16
  • How to make Angular SSR wait for async operations to finish that are initiated in ngOnInit?
  • I want to install @angular/google-maps npm Package in angular 16.2.12 but "npm install @angular/google-maps" this is not working/ tell me other query
  • Angular 17 standalone application integrate CKEditor 5 -- Error: window is not defined
  • Why is $scope >= 0 showing true in interpolation while empty in controller?
  • The XMLHttpRequest compatibility library was not found
  • Making Gantt Chart Column Labels More Readable
  • Pass key-value pairs of object as individual arguments to component in Angular

Related Questions in BOOTSTRAP-MODAL

  • How to access variable to pass through url_for() as src in Flask App
  • Edit button in each row of table using same Bootstrap modal as add button
  • navbar not appear in the result?
  • .NET MVC Bootstrap Modal not showing up
  • Opening a Bootstrap Modal will freeze the entire page (angular)
  • How to have a modal popped up after a post controller has submitted, should I create a new controller for it? Im new to asp.net
  • How to Prevent Select2 Dropdown from Moving with Scroll inside a Bootstrap Vue Modal?
  • modal is not shown up when convert to vue 3
  • I created the model and set the primary key. How to show model primary keys in Django templates
  • jest test if modal component is being opened
  • Bootstrap 5.3 Scrollable Modal with Form in body and submit button in footer
  • How to close an ngbactive modal programatically without the modal being closed
  • Angular getting error for modal: Property componentInstance does not exist on type
  • Why is my modal not populating all my data
  • Resetting bootstrap modal after closing it

Related Questions in MD-AUTOCOMPLETE

  • Display only one attribute of arrayed objects in md-autocomplete :md-options
  • md-autocomplete when selecting a dropdown item object it says [Object Object]
  • vue-material mdAutocomplete inside electron-vue app - setup problems
  • md-autocomplete does not work for number field in angularjs
  • md-autocomplete displays results as a list instead of dropdown
  • <md-autocomplete> is not initializing.
  • How can I get on my servlet the ID value instead the displayValue using md-autocomplete?
  • md-autocomplete in md-dialog loses focus onclick
  • Angular4 Material chipset+autocomplete
  • md-autocomplete returns TypeError: Cannot read property 'then' of undefined
  • access md-autocomplete input value before model debouce evaluation in AngularJs
  • How to make md-search-text-change wait for 1000ms before firing a call?
  • How to sort list start with first and then contains string search in md-autocomplete AngularJS
  • How to change options when searching in md-autocomplete
  • md-autocomplete searching with query issue

Popular Questions

  • How do I undo the most recent local commits in Git?
  • How can I remove a specific item from an array in JavaScript?
  • How do I delete a Git branch locally and remotely?
  • Find all files containing a specific text (string) on Linux?
  • How do I revert a Git repository to a previous commit?
  • How do I create an HTML button that acts like a link?
  • How do I check out a remote Git branch?
  • How do I force "git pull" to overwrite local files?
  • How do I list all files of a directory?
  • How to check whether a string contains a substring in JavaScript?
  • How do I redirect to another webpage?
  • How can I iterate over rows in a Pandas DataFrame?
  • How do I convert a String to an int in Java?
  • Does Python have a string 'contains' substring method?
  • How do I check if a string contains a specific word?

Trending Questions

  • UIImageView Frame Doesn't Reflect Constraints
  • Is it possible to use adb commands to click on a view by finding its ID?
  • How to create a new web character symbol recognizable by html/javascript?
  • Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
  • Heap Gives Page Fault
  • Connect ffmpeg to Visual Studio 2008
  • Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
  • How to avoid default initialization of objects in std::vector?
  • second argument of the command line arguments in a format other than char** argv or char* argv[]
  • How to improve efficiency of algorithm which generates next lexicographic permutation?
  • Navigating to the another actvity app getting crash in android
  • How to read the particular message format in android and store in sqlite database?
  • Resetting inventory status after order is cancelled
  • Efficiently compute powers of X in SSE/AVX
  • Insert into an external database using ajax and php : POST 500 (Internal Server Error)
  • Privacy
  • Terms
  • Cookies
  • Homegardensmart
  • Math
  • Aftereffectstemplates