AngularJS odd behaviour with model in view -


i having pretty odd behaviour model/view data in angular. 2 issues really. in controller, have following code, used update dates in view.

$scope.setcurrentdates = function () {                  var centreindex = $scope.state.indexofcentredate,                     centreindexitem = $scope.state.alldays[centreindex],                     itemleft = $scope.state.alldays[centreindex - 1],                     itemright = $scope.state.alldays[centreindex + 1];                  $timeout(function () {                      $scope.state.currentdates.centre =  $scope.state.alldays[centreindex].isostringdate;                     $scope.state.currentdates.left = itemleft.isostringdate;                     $scope.state.currentdates.right = itemright.isostringdate;                      $scope.state.isupdatingdate = false;                  });             }; 

and in view, have following right/progress nav arrow:

    <a>         <span class="day">{{state.currentdates.right | navdate : 'dd'}}</span>         <span class="month">{{state.currentdates.right | navdate : 'mmm'}}</span>         <span class="year">{{state.currentdates.right  | navdate : 'yyyy' }}</span>      </a> 

$scope.setcurrentdates in controller gets called every click of above nav.

so, first issue follows:

when first loading page, no text dates displays. however, when inspect element in dev tools, , example increase font size 50px 51px, text displays. click through nav, dates not update should in view. but when inspect element again, , decrease font size 50px, dates update ??? bizarre. happens 1 of css properties element modify.

they update should each click, stop updating again until modify css again.

at first though scope issue not sure dates update correctly when logged out in console. must related chrome/css rendering.

further bizarreness per attached. can see dev tools dom, representing correct values, including within element #console represented black box rendered on screen.

enter image description here

it looks may isolated chrome.

any advice appreciated.

thanks,

dave

the solution chrome rendering issue found here: google fonts not rendering on google chrome.

it comes down chrome being told re-render fonts.


Comments

Popular posts from this blog

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -