The disappearing canvas: a word on copying sample code from Angular Material

Hopefully this saves someone else the same headache it caused me:

If you copy code samples from Angular Material examples, make sure to remove the “ng -cloak” class from the outer container elements, or else your canvas will disappear at runtime!

The “ng-cloak” class has one property, and that’s “display: none”– I’m not sure why it’s included in so many of the example code snippets, but something tells me I’m missing something (like maybe a script that sets it visible at runtime?). 

I don’t care to admit how long I hit my head against the wall trying to figure out why the entire canvas disappeared at runtime until I checked the CSS. I just assumed my angular code wasn’t working. 

Advertisements