Yeah, don’t do it. I’m sad to say but dynamically adding and changing the templates for components is not supported in ionic 2. This is due to the use of AoT compilation (Which improves speed, among other things) since compiles all templates beforehand, and not during runtime. For this reason the compiler is not available during runtime when using AoT, and therefore it just is not possible to do what I wanted to do. I’m afraid you’ll have to try and find another way around it, unless of course you are willing to live with the drawbacks of running on a debug build in production.
You can do this because the latest (RC4) allows you to build with the “–prod” flag which builds the app with AoT. Omitting that flag gives you a debug build, not utilizing AoT, which therefore should leave the runtime compiler available for your app. Again, this is NOT in any way recommended, but it CAN be done.