I try to insert a css rule with typescript based on https://www.w3.org/wiki/Dynamic_style_-_manipulating_CSS_with_JavaScript. The method insertRule is not recognized. I have the following error:
Type 'StyleSheet' is not assignable to type 'CSSStyleSheet'. Property 'cssRules' is missing in type 'StyleSheet'.
Here is my code:
let stylesheet: CSSStyleSheet = document.styleSheets[0];
stylesheet.insertRule(".scroll-content { overflow: hidden;}",0);
I'm working with ionic 2 and angular 2.