Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

ngModel, required by directive 'input', can't be found! #526

Closed
petterfreak opened this issue Dec 17, 2014 · 7 comments
Closed

ngModel, required by directive 'input', can't be found! #526

petterfreak opened this issue Dec 17, 2014 · 7 comments

Comments

@petterfreak
Copy link

Hi,

I'm trying to use the default ui-select example in my app, but the ui-select doesnt show up. (None of them work)

<ui-select ng-model="address.selected"
     theme="bootstrap"
     ng-disabled="disabled"
     reset-search-input="false"
     style="width: 300px;">
      <ui-select-match>{{$select.selected.formatted_address}}</ui-select-match>
             <ui-select-choices repeat="address in addresses track by $index"
                   refresh="refreshAddresses($select.search)"
                    refresh-delay="0">
                    <div ng-bind-html="address.formatted_address | highlight: $select.search"></div>
               </ui-select-choices>
 </ui-select>

Console error in every cases:
1.
Error: [$compile:ctreq]
Controller 'ngModel', required by directive 'input', can't be found!

TypeError: Cannot read property 'source' of undefined

var data = $select.parserResult.source (scope, { $select : {search:''}}), //Overwrite $search

I'm using Angular 1.3.6

@kedarbe
Copy link

kedarbe commented Dec 24, 2014

+1 , i am facing same issue ..using Angular 1.3.7

@MikeABentley
Copy link

+1

@petterfreak
Copy link
Author

kedarbe,MBentley1976
Did you find a solution for this problem?
If not, which enviroment do you use it (angular libs...etc)?

I have this problem since december... Its just a default demo examples... annoying

@MikeABentley
Copy link

Hey Petterfreak, it works for me when using a single select control. You just have to be sure that the model value bound to control (in your example above that would be address.selected) is initialized as null/undefined.

I have not been able to get this to work on a multi-select control. In that instance I wrote a custom validator. For now I only need this in one place, so it's in that form's controller. I've since written an extension of this control, so I'll move it up into there as needed.

@lukaszgrolik
Copy link

The project which I'm working on uses a lot of ui-selects (including multiselects) and every one of them throws this error. I'm using Angular 1.2.28 and ui-select 0.9.6 (the same problem with latest 0.11.2). @MBentley1976's suggestion doesn't work for me. @petterfreak did you find a solution?

@petterfreak
Copy link
Author

Hi Lukaszgrolik,

Yes, i found a "solution"... The problem was my fault :).

Do you use this module in your app? https://github.com/luisfarzati/ng-bs-daterangepicker
Because this module conflicts with the ui.select. (For a long time, i did not recognize it, because the module's name is "ngBootstrap" :)) )

If you don't use it then my advice for you : you should check all of your modules

@lukaszgrolik
Copy link

Yeah, that's exactly it :) Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants