AngularJS: Nested Component inside of a modal cannot find required component

54 views
Skip to first unread message

Wen

unread,
Jul 18, 2018, 1:55:09 AM7/18/18
to Angular and AngularJS discussion

Question: I'd like to understand why the nested component,secretAccessPass, inside of my modal cannot find the required component it needs. Additionally, given a component which requires another component, what is AngularJS's process for finding this required component?

Assumptions: I assumed that the require syntax for a component with require: '^^Ctrl' meant that the parent on the DOM is required to have the required element. Which was why I passed the scope of baseAccessCode into the scope attribute of $uibModal, thereby making the scope the modal's parent scope. But this didn't work either.

Error: When I click on modifyOrder(), I encounter the following error -> "angular.js:14328 Error: [$compile:ctreq] Controller 'baseAccessPass', required by directive 'secretAccessPass', can't be found!"

Requirements: secretAccessPass has to be in the modal, and that it has to require baseAccessPass.


Demo Plunkr

Sander Elias

unread,
Jul 18, 2018, 6:04:34 AM7/18/18
to Angular and AngularJS discussion
Without looking at your code, I would say you need to inject the service that holds your secret into the modal's controller.

Regards
Sander

Chas Yen

unread,
Jul 28, 2018, 1:50:14 AM7/28/18
to ang...@googlegroups.com
Thank you Sander!
--
You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages