how to use(inject) html/page in other pages?
i know how to use providers and directives, bu cant manage to inject page html in other page html:
(i put # in code otherwise it doesn’t show)
example:
selector: p-1
export…p1
page1.html:
<p>this is page 1</p>
and in page2.html:
<p-1></p-1>
result of page 2:
this is page 1
If that’s the structure of what you want to achieve, use normal components, don’t use pages. They’re not designed to be injected in the template way. They are designed to be pushed on a stack and then they’ll be shown to the user.
If you want to put code on the forum, select your code and format it with the < /> button btw.
1 Like
thanks for the answer.
can i use angular components in ionic?? same syntex?
and if you can show me the </> thing…didnt understand.
thanks,
Yes you can use normal angular2 components inside an ionic app. A page is actually also a component, but it’s a ‘special’ component.
tnx
and how do i paste code?
<#p>?
didnt understand your answer
Use the button on the text editor:
Please edit your post and use the </>
button above the post input field to format your code or error message or wrap it in ```
(“code fences”) manually. This will make sure your text is readable and if it recognizes the programming language it also automatically adds code syntax highlighting. Thanks.
1 Like