EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
May 13, 2024, 12:27:16 AM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
EasyUI for Angular
>
How to dynamically create a tabpanelcomponent and add it to an existed Tabs?
Pages: [
1
]
« previous
next »
Print
Author
Topic: How to dynamically create a tabpanelcomponent and add it to an existed Tabs? (Read 7906 times)
softboy99
Newbie
Posts: 43
How to dynamically create a tabpanelcomponent and add it to an existed Tabs?
«
on:
February 02, 2018, 02:17:14 AM »
I use the way of angular dynamic loading. But failed with the following:
core.js:1440 ERROR Error: StaticInjectorError(AppModule)[TabPanelComponent -> TabsComponent]:
StaticInjectorError(Platform: core)[TabPanelComponent -> TabsComponent]:
NullInjectorError: No provider for TabsComponent!
Logged
jarry
Administrator
Hero Member
Posts: 2264
Re: How to dynamically create a tabpanelcomponent and add it to an existed Tabs?
«
Reply #1 on:
February 02, 2018, 07:12:13 PM »
Please look at this example
https://www.jeasyui.com/demo-angular/main/index.php?plugin=Tabs&theme=material&dir=ltr&pitem=Dynamic%20Tab%20Content&sort=
Logged
softboy99
Newbie
Posts: 43
Re: How to dynamically create a tabpanelcomponent and add it to an existed Tabs?
«
Reply #2 on:
February 03, 2018, 03:00:48 AM »
Thanks a lot. In the sample, each time click "adddatagrid" button, it will add a new tab. Is it possible just allow the first time, when 2nd time or later just make the former 1st added tab active.
Logged
jarry
Administrator
Hero Member
Posts: 2264
Re: How to dynamically create a tabpanelcomponent and add it to an existed Tabs?
«
Reply #3 on:
February 03, 2018, 06:19:00 PM »
That's simple, you can detect the existing tab panel. If not create it otherwise select it. For more information please look at the example in previous post.
Logged
softboy99
Newbie
Posts: 43
Re: How to dynamically create a tabpanelcomponent and add it to an existed Tabs?
«
Reply #4 on:
February 04, 2018, 10:35:42 PM »
Is it possible to use component name string "Dy1Component" to load component, so that AppComponent doesn't depend on Dy1Component. Because may be there many commponents.
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...