javascript - Angular JS ng-cloak is not working properly expression symbol showing when page loaded -


i new angular js , trying fix issue of html code displays before gets evaluated. first showing expression , value. have added ng-cloak in body, not working. i, then, tried add html top section, no luck. checked below link:

ng-cloak not working when page load

but not able find correct solution this.

html:

<body ng-app="rootapp" ng-cloak> <div class="pname" ng-init="getdetails()">                         <strong> {{desc}} <br>                         {{shortdesc}} {{name}}</strong>                     </div> </body> 

controller code:

$scope.getdetails = function () {  //  service call         service.getname({ id: 3 }).$promise.then(function (data) {             if (data.length > 0) {                 $scope.desc = data[0].desc;                 $scope.shortdesc = data[0].shortdesc;                 $scope.name = data[0].name;             }          });      } 

when use ng-cloak put ng-cloak in css please follow url https://docs.angularjs.org/api/ng/directive/ngcloak


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -