N
N
Nikita Kit2017-05-24 02:49:55
JavaScript
Nikita Kit, 2017-05-24 02:49:55

Why doesn't ng-controller work when the html template is generated correctly?

Guys, please help. I'm a couple of years behind, only right now I was seized to learn Angular.
I am scratching my head.
Everything breaks for me when I add ng-controller='DemoCtrl' to .helloWorld
In the console, the error DemoCtrl is not a function. In main coffee only DemoCtrl = -> alert('Hello World!'). tmp is generated correctly, as in the markup of the tutorial
First I saw the difference that I add scripts to the end of body. But moving them to head still didn't help.
7649046b79e8423085b079887f388bf3.png
Angular is connected version 1.3.4
https://jsfiddle.net/L8cqmbbw/
UPD
npm i angular and require angular helped a little better:
The controller with the name 'DemoCtrl' is not registered

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Manakov, 2017-05-24
@gogolor

Well, you need to register it (DemoCtrl) =)))
Isn't Google suggesting anything?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question