M
M
Madion2016-08-18 13:19:32
Angular
Madion, 2016-08-18 13:19:32

DOM angularjs not updating - why?

Good afternoon!
Please help me with this question.
In angularjs - complete zero.
Angular version 1.4.3.
In the viewer, this is the code:

<div class="poster" on-drag-down="openPoster()">
       <img src="{{poster}}" id="poster">
</div>

in the controller like this:
var img_height = "500px";
var img = document.getElementById('poster');
img.onload = function () {
    img_height = this.height + "px";
}

$scope.openPoster = function () {
    var poster = document.getElementsByClassName('poster')[0];
    poster.style.height = img_height;
    poster.classList.add('open'); //!!!!!! смотрю в firebug: класс open к элементу -  не назначается !!!! - почему????
    console.log(poster.classList); //хотя в консоли выводит poster open
}

Question removed! I'm a careless piece of shit.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question