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

Error when doing $compile within the <ui-select> Tag #1856

Closed
pascDa opened this issue Nov 22, 2016 · 1 comment
Closed

Error when doing $compile within the <ui-select> Tag #1856

pascDa opened this issue Nov 22, 2016 · 1 comment

Comments

@pascDa
Copy link

pascDa commented Nov 22, 2016

Bug description:

We use a directive that requires ngModel at the same Element (our Directive needs to be at the Tag where the ng-model Attribute is set). Our Directive removes itself, adds other custom directives via setAttribute and compiles the Element again. The Elements HTML was already changed at that Point so a Exception is thrown during $compile.
While $compile the following Exception is thrown:
angular.js:13920 Error: [$compile:ctreq] Controller 'uiSelect', required by directive 'uiSelectSingle', can't be found!

Link to minimally-working plunker that reproduces the issue:

http://run.plnkr.co/plunks/Y0WtNZgaasUbdx3LvzSn/
http://plnkr.co/edit/Y0WtNZgaasUbdx3LvzSn?p=preview

Version of Angular, UI-Select, and Bootstrap/Select2/Selectize CSS

Angular: 1.5.8
UI-Select: 0.19.3
Bootstrap/Select2/Selectize CSS: n/a

@user378230
Copy link
Contributor

A recent PR on angular updates the docs to warn that double compliation may cause misbehaving directives: https://github.com/angular/angular.js/pull/15392/files#diff-4148e86088d774bf70bda69fab6f4d4fR385

And the team state that it isn't supported: angular/angular.js#15392 (review)

As such I'm going to close this as a usage issue rather than a bug, you're welcome to submit a targeted, unit tested PR if you find a solution.

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

2 participants