I have a rather simple page, it calls 2 static json files to populate it and what i am noticing in FF and chrome if I look quick is that I see the tags at runtime in the page and then they are updated a second later (literally 500ms later)
here is a short video.
http://screencast.com/t/RZhEIxKj5
here is what the waterfall looks like
http://screencast.com/t/Be3JvLIYK00P
here is what the controller looks like
function HotelsController($scope, $http) {
$http.get('data/hotels.json').then(function(res){
$scope.hotels = res.data;
});
}
function ConfirmationsController($scope, $http) {
$http.get('data/confirmations.json').then(function(res){
$scope.confirmations = res.data;
if ($scope.confirmations.length > 0) {
$scope.showConfirmations = "1";
}
else {
$scope.showConfirmations = "0";
}
});
}
and here is what my json looks like
[
{
"nights": 2,
"hotel": "Hotel McCormick Place",
"confirmationNumber": "2345J453",
"checkIn": "18-Dec",
"checkOut": "20-Dec",
"roomType": "King, None-Smoking"
},
{
"nights": 1,
"hotel": "ABC Inn",
"confirmationNumber": "1234567",
"checkIn": "20-Dec",
"checkOut": "21-Dec",
"roomType": "Standard, None-Smoking"
}
]
[
{
"name": "Empire Hotels",
"img": "http://placehold.it/96x64",
"address": "123 Main Street, Texas"
},
{
"name": "Lemon Tree Hotel",
"img": "http://placehold.it/96x64",
"address": "123 Main Street, Texas"
},
{
"name": "Palm Fiber",
"img": "http://placehold.it/96x64",
"address": "123 Main Street, Texas"
}
]
Use ng-cloak
class to control this flash. Check detail help ins angular's FAQ page — http://docs.angularjs.org/api/ng.directive:ngCloak
In template:
<div ng-app class="ng-cloak">
…
</div>
In CSS:
.ng-cloak {
opacity: 0;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With