Skip to content

Instantly share code, notes, and snippets.

@cssquirrel
Created May 7, 2015 23:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cssquirrel/9a5d6c27b3beee53a793 to your computer and use it in GitHub Desktop.
Save cssquirrel/9a5d6c27b3beee53a793 to your computer and use it in GitHub Desktop.
Prevent Flash of Raw Angular Template
<!-- doctype html -->
<html>
<head>
<!-- If not including Angular.js in header, include in CSS -->
<style type="text/css">
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
display: none !important;
}
</style>
</head>
<body>
<div data-ng-app="appName" data-ng-controller="controllerName">
<p data-ng-cloak>This paragraph and any {{bindings}} will not show up until after Angular has kicked in.</p>
</div>
<!-- rest of page and all that crap like script elements goes here -->
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment