D
D
Denis Denis2015-11-22 18:39:09
Angular
Denis Denis, 2015-11-22 18:39:09

Why isn't a function written to scope?

I want to install a handler.
In the textbook so

Добавьте новый метод в контроллер PhoneDetailCtrl:

  $scope.hello = function(name) {
      alert('Привет, ' + (name || 'мир') + '!');
  }
и элемент:

  <button ng-click="hello('Elmo')">Привет</button>
в шаблон phone-details.html.

Moreover, the number and the string are written, but the function cannot be written, in scope
hello: null
Thank you
ps Damn, it doesn’t work in chrome, it works in Mozilla

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Denis, 2015-11-22
@golovewkin

Hmm :)
I also thought about the browser cache, but it didn't seem to help.
then i changed
to
Voila, everything works.
Not a very pleasant introduction to Angular :(

S
Sergey, 2015-11-22
Protko @Fesor

browser cache.
ps I recommend you a plan for studying angular: ngExam

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question