javascript - JQuery doesn't get the changes that angularjs does -
i've got set angularjs
<span data-end-time="{{ productauctionend | date:'yyyy,mm,dd,hh,mm,ss' }},000" class="detail-rest-time js-time-left"></span>
and when use jquery
$(".js-time-left").each(function() { console.log($(this)); console.log($(this).data("end-time")); }
the first log prints screen:
<span data-end-time="2016,06,12,15,03,59,000" class="detail-rest-time js-time-left"></span>
the second log prints this:
,000
can please me out
just call jquery logic after angular , work.sometimes 2 don't play nice together:
<script src="~/scripts/angular.js"></script> <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js' type="text/javascript"></script> <script type="text/javascript"> var myapp = angular.module("app", []); myapp.controller('controller', function ($scope, $http) { $scope.productauctionend = new date(); }); </script> <script type="text/javascript"> $(function () { $(".js-time-left").each(function () { console.log($(this)); console.log($(this).data("end-time")); }); }); </script> <div ng-app="app" ng-controller="controller"> <span data-end-time="{{ productauctionend | date:'yyyy,mm,dd,hh,mm,ss' }},000" class="detail-rest-time js-time-left"></span> </div>
output in google chrome console:
Comments
Post a Comment