Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Why can't I import NavController and ViewController into Service or App?

$
0
0

@asteffes wrote:

I'm attempting to inject NavController and ViewController into either my app.js file or a custom service.

My objective is (or was) to pass the current view into a "LeftMenuManager" service class. Some pages I need the leftmenu to be disabled, others I do not. The LeftMenuManager service would be responsible for flipping the switch based on the view name.

However, I'm unable to inject these dependencies - I get an error about "No provider for NavController...".

I get the sense that I'm doing something backwards, but I don't know exactly what. As most people, I'm new at this.

I understand that I'm attempting to inject controllers into non-pages. If this is the case, is there a central "master" page that will be called each time outside of the app.html?

Can someone please help me understand why I can't do this? Or, if it's possible, what it is that I'm missing?

Thanks in advance.

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles