stock-dog
stock-dog copied to clipboard
Error: [$compile:ctreq] Controller 'select', required by directive 'ngOptions', can't be found!
Error: [$compile:ctreq] Controller 'select', required by directive 'ngOptions', can't be foun How can I resolve this problem ?
I have the same problem. I think it comes from this line:
in addstock-modal.html
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
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 the stock never gets populated due to another issue - https://github.com/diegonetto/stock-dog/issues/4
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
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 :(