-
-
Notifications
You must be signed in to change notification settings - Fork 240
feat: NS 4.0 Integration #1250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat: NS 4.0 Integration #1250
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ghost
ghost
assigned
vakrilov
Mar 22, 2018
@ghost
ghost
added
the
in progress
label
Mar 22, 2018
@vakrilov
vakrilov
force-pushed
the
ns-40-first-phase
branch
from
March 23, 2018 09:41
f5f6543 to
20f6a90
Compare
@ghost
ghost
assigned
SvetoslavTsenov
Mar 25, 2018
test
@SvetoslavTsenov
SvetoslavTsenov
force-pushed
the
ns-40-first-phase
branch
from
March 25, 2018 13:27
f74be62 to
1808866
Compare
Angular application is started with `application.run()` which means the the root view of the app will be the root view of the `AppComponent`. Previous behavior: Anagular application was started with `application.start()` - this aways creates a root `Frame`. The platfrom bootstrap was always creating the inital `Page` and loading the `AppComponent` inside. The `<page-router-outlet>` will create a Frame as a native element and will create a page for each component activated in it (including the inital page).
...improved relative url handling
Add `tsc-w` script to plugin's `package.json` file.
Rename RootView class to AppHostView class. Expose ngAppRoot property of AppHostView class. Add modal-nested-test example.
test
@vakrilov
vakrilov
force-pushed
the
ns-40-first-phase
branch
from
March 28, 2018 14:13
cca244f to
1d7237a
Compare
test
test
2 similar comments
test
test
SvetoslavTsenov
SvetoslavTsenov
approved these changes
Mar 29, 2018
@vakrilov
vakrilov
changed the title
(削除) [Do not merge]feat: NS 4.0 Integration (削除ここまで)
(追記) feat: NS 4.0 Integration (追記ここまで)
Mar 29, 2018
@ghost
ghost
removed
the
in progress
label
Mar 29, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
Bootstrap and Navigation
NativeScript 4.0 allows you to put any view as the root(not only Frame) of the application. To support in angular projects we had to introduce some changes in how A{N}gular apps are bootstrapped.
Previous Behavior
Bootstrap creates a root
Frameand initialPage. Then it bootstraps the angular application inside this page. Navigation with<page-router-outlet>will always navigate in theFramecreated by the bootstrap.Limitations:
RadSideDrawerfor example). It is always theFramecreated by the bootstrap.<page-router-outlet>as there is only oneFrame.Pageview wrapping your components and you can always. Because theActionBaris part of thatPageyou can always change it with the<ActionBar>component.New Behavior
Bootstrap will not create root view by default. It will use the root view of your main application component as the root view of the application. The
<page-router-outlet>component will create its ownFrameand will use it for navigation. It will also wrap the components you navigate to in aPageand will navigate to it as it did before.Which means:
You can use any view for application root. Finally, you can have application-wide
RadSideDrawer.You have more flexibility over where to place the
<page-router-outlet>, you can even have more than one for more advanced scenarios.If you don't use
<page-router-outlet>in your app you will not get the defaultPageandFrame, which means you will not be able to inject them in you components or show theActionBar. There is specialcreateFrameOnBootstrapoption you can pass on bootstrap to make things as before:<page-router-outlet>you probably don't have to do any changes. Bootstrap will not createFrameandPage, but the outlet will do that. It will also take care of providingPageand so theActionBarshould work as before.Working with Frames
There might be multiple frames (if you have multiple
<page-router-outlet>'s). Angular DI works with singletons, so it will always return one instance ofFrame. We have introducedFrameService(still experimental) which has agetFrame()method. It will return the current frame (the one you have navigated last).