0

I've searched the Ui-Router Controller Docs and read this here on stack overflow, along with other Google Searches. I'm trying to assign a controller to a state, but I get the the error:

Uncaught Typeerror: [$injector:modulerr]...controller cannot be found

I've borrowed a simpole Codepen to show a similar outcome to what I get in my code.

If I remove exampleCtrl from my state definition all works fine:

...
.state('tab1', {
   name: 'tab1',
   url: '/tab1',
   template: '<div class="tab tab1"><p>Caerphilly</p></div>',
   controller: exampleCtrl
})
...

Is this a matter of order? or am I missing something.

1 Answer 1

2

controller: "exampleCtrl" instead of controller: exampleCtrl

Sign up to request clarification or add additional context in comments.

1 Comment

Wow that's a silly mistake. Sometimes we need a second set of eyes. Thank you.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.