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

typeahead custom templates with directives that have "require" option #2679

Closed
ostruk opened this issue Sep 9, 2014 · 0 comments
Closed

Comments

@ostruk
Copy link

ostruk commented Sep 9, 2014

If a template contains a directive that has a "require" option it will fail with the error stating that required controller can't be found. To fix I replaced element.replaceWith($compile(tplContent.trim())(scope)); to

var tplEl = angular.element(tplContent.trim());
element.replaceWith(tplEl);
$compile(tplEl)(scope);

inside typeaheadMatch directive. This places the element into the DOM before compiling it, thereby resolving the issue of the missing dependent controller.

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

Successfully merging a pull request may close this issue.

3 participants