Yruama
April 18, 2018, 9:24am
1
Hello,
i want to create my own html tag to transform :
<div class="class">
<div class="subClass">
</div>
</div>
to :
<class>
<subClass>
</subClass>
</class>
What i find is to do something like this :
class {
//css
}
document.createElement('class');
But i don’t know how to add a custom script, or where i can add this line.
thanks !
hello,
maybe what are you looking for are custom components.
Here for a simple one. https://audacitus.com/site/2017/01/04/custom-feed-component-ionic-2-part-1/
Best regards, anna-liebt
Yruama
April 18, 2018, 12:47pm
3
Hello,
i just want to ceate html tag to use css on them without write <div class="class"> </div>
but <class> </class>
to write code speedly.
Your example looks like “include file”
Thanks
Yruama
April 18, 2018, 12:51pm
5
Yep but i get an error :
Uncaught Error: Template parse errors:
'hs' is not a known element:
1. If 'hs' is an Angular component, then verify that it is part of this module.
2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
</ion-header>
[ERROR ->]<hs> test </hs>
Yruama:
To allow any element add ‘NO_ERRORS_SCHEMA’ to the ‘@NgModule.schemas ’ of this component. ("
</ion-header>
This is the solution for you. Try this.
1 Like
Yruama
April 18, 2018, 12:59pm
7
Juste like that :
schemas: [
NO_ERRORS_SCHEMA
]
:o i’m so stupid …
thanks
Sometimes we ignore the error messages and tricks for solutions
1 Like