Custom directive tag won't render


#1

I have been struggling to get custom HTML tags working in my app. I was able to fork a demo plnkr and reproduce it fairly easily. I’m hoping I’m just missing something small, but here it is:

There are two new buttons at the bottom of the playlists page, but only one renders. Using an attribute works fine, but even though restrict is set to ‘AEC’, the custom element tag will not work. Thanks to anyone for a second set of eyes.

Edit: I should also note that even the attribute version does not seem to work correctly when deployed to my phone, an iPhone 5S. The template seems to render but the scope does not appear to get initialized. This one’s a bit harder to demonstrate via a plnkr though.

Edit 2: This does happen in beta 11, just in case that isn’t clear.


#2

found it :smile:
its a typo: instead of restrict you used retrict
And some other advises:

  • use single quotes in template so you don’t have to escape double quotes.
  • and you could update ionic to beta.11
  • do you want a isolated scope for your directive? (Scope: { } will create one for this directive)

i hope i could help


#3

Ack, I knew it was going to be something like that. Thanks for taking a look!