stock-dog icon indicating copy to clipboard operation
stock-dog copied to clipboard

Error: [$compile:ctreq] Controller 'select', required by directive 'ngOptions', can't be found!

Open azdineh opened this issue 9 years ago • 6 comments

Error: [$compile:ctreq] Controller 'select', required by directive 'ngOptions', can't be foun How can I resolve this problem ?

azdineh avatar Dec 03 '15 22:12 azdineh

I have the same problem. I think it comes from this line:

in addstock-modal.html

WiHHi-Z3-PuX avatar Jan 14 '16 21:01 WiHHi-Z3-PuX

As of angular 1.4 you can not use ng-options on any other element except select. You can check this issue on angular-strap documentation. You can choose to use their alternative to ng-options,ie. bs-options. For now that will work. But later on when you start pulling data from yahoo finance you will have another issue. So I suggest you use select tag instead of input tag. Of course you won't be able to use nice autocomplete thing but you will be able to complete the chapter

Jakhotiya avatar Feb 12 '16 10:02 Jakhotiya

Has anyone gotten past this error? Being new to angular, I tried to replace the input with a select tag. I'm not seeing any errors however the Stock never gets populated. This is the tag I replaced the input with:

<select class="form-control" id="stock-symbol" ng-model="newStock.company" ng-options="company as company.label for company in companies" bs-select></select>

rhjennings avatar Oct 18 '16 01:10 rhjennings

@rhjennings the stock never gets populated due to another issue - https://github.com/diegonetto/stock-dog/issues/4

jtsnr avatar Nov 25 '16 14:11 jtsnr

We have to use bs-options instead of ng-options. AngularStrap provide a directive bs-options for TypeAhead. http://mgcrea.github.io/angular-strap/#typeaheads

rohtashsethi avatar Sep 22 '17 08:09 rohtashsethi

Well, well, this answers my question of why ul and li elements are used in the bootstrap dropdown, (and not select and option elements)

It's a shame there isn't a walkthrough on using bootstrap components with angularJS 1.4.9 anywhere :(

robeverett avatar Feb 28 '18 12:02 robeverett