Comments (2)
Thank you Simon for your input, good point! We are working on a feature which allows specifying kind of an entry point when no view is showing.
As of now, you can configure a route which redirects to your activity component as follows:
RouterModule.forRoot([
{path: 'your-activity', component: YourActivityComponent},
{path: '', redirectTo: '/(activity:your-activity)', pathMatch: 'full'},
]),
Then, however, you cannot close the activity anymore. Using an URL matcher has the limitation that you cannot inject the Router
to query the initial navigational state. A hacky workaround would be by checking some static accessor whether the initial navigation is over.
In Routing module, add the following route and matcher function:
RouterModule.forRoot([
{path: 'your-activity', component: YourActivityComponent},
{matcher: initialEmptyPathMatcher, redirectTo: '/(activity:your-activity)'},
]),
export function initialEmptyPathMatcher(segments: UrlSegment[], group: UrlSegmentGroup, route: Route): UrlMatchResult {
// check if not navigated yet and if the path is empty
if (!(document as any).navigated() && segments.length === 0) {
return {consumed: segments};
}
return null;
}
In app.component.ts
add the following constructor:
@Component({selector: 'app-root', templateUrl: './app.component.html'})
export class AppComponent {
constructor(router: Router) {
(document as any).navigated = (): boolean => router.navigated;
}
}
from scion-workbench.
See issue #105
from scion-workbench.
Related Issues (20)
- Load views lazy when they are activated
- Provide way to open peripheral views in maximized mode
- Enable micro applications to define and contribute to perspectives
- Support for merging newly added or moved parts into the user's layout
- Workbench icon font not loaded for applications deployed in a subdirectory
- Clearing local storage to reset layout has no effect
- Opening the app in multiple windows sometimes overwrites perspectives
- Perspective sometimes has stale layout if opened in multiple browser windows
- Fail to open app from URL with view outlets of perspectival views
- Allow for navigation to empty path auxiliary routes
- Moving view to new window should open the view "standalone" in a blank window
- Refactor API-specific workbench page objects to more closely reflect the underlying API
- Migrate to Angular 17 HOT 1
- Provide API to contribute and track the current workbench selection
- Support for view routes which are children of the "empty path" top-level route
- Provide dialog component for displaying a component or microfrontend
- Display the start page without a part
- Support for keyboard navigation between views HOT 1
- Enable microfrontends to apply styles based on their embedding context
- Dragging viewtab, which is partially out of viewtab's viewport, breaks layout
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scion-workbench.