Tagged Questions
0
votes
1answer
14 views
Angular2 Tabs and Routes
Is there a way to open each of the anchro click (for example from menu) in a separate tabs in angular?
Instead of opening all routes in same router-outlet.?
I tried named router-outlet but child sub ...
0
votes
1answer
34 views
Angular2 using functions in router data?
I think the problem should be clear with this pseudo code. Can't find any solution for this. How to solve this?
Current working route:
{
path: ':xyzType',
component: SuperSpecialComponent,
...
0
votes
1answer
22 views
CanActivate Promise<boolean> does not navigatebyurl after reject
Finally got CanActivate when trying to divert different users by their roles to different areas of the app. However, if they go to the wrong route, I can't get this to redirect. Here's what I have:
...
0
votes
1answer
31 views
model driven vs template driven in angular 2
I am new in Angular2. I read may article on model driven vs template driven.
There are some advantages/Disadvantages of both so my question is that which one is better to start a new project.
I also ...
0
votes
1answer
44 views
Binding data Angular2 ui-router between component <=> parent state <=> child state
Here's the gist of what I'm trying to do. I have a header component with a Dark/Light theme for Angular2 Material. The header component lives inside of the 'main' state. I have a nested <ui-view>...
0
votes
0answers
19 views
Can I use nested components linked with same app module? Is it good practise? Using component Router
Here is component structure of my application. Any advice will be valuable. Root component is app.
Which has two components as child : login & home.
home has two child components : dummy-...
0
votes
2answers
23 views
Why UI-Router has stopped using hash character?
I have started to see something about Angular2, in particular UI-router states and routes. What I noticed is that contrary to Ang1 now I must not use '#' character in order to navigate from a route to ...
0
votes
1answer
24 views
Wildcard route with ui-router-ng2?
I'm attempting to use ui-router-ng2 with Auth0, an authentication-as-a-service provider. The problem is that after login Auth0 redirects the user to a url that looks like this:
http://localhost:3000/#...
0
votes
1answer
20 views
multiple view (master-child) with ui-router-ng2 and component refresh
I am using ui-router-ng2 in a multi ui-view configuration, with a master list component and a child details component.
let state = {
name: 'hello',
url: '/',
views: {
'dashboard': {
...
-2
votes
0answers
22 views
AngularJS Page Navigation and routing
I am new to Angular2 and I am doing one POC for feature where we have different navigations from pages : Requirement is as follows :
1. Login Page
2. User Input Page
3. Summary Page (Left Navigation ...
0
votes
0answers
38 views
ui-router style resolve for Angular router?
Angular's native router module has a resolve option for the state definition which allows the user to provide values for the routing state before routing to a component.
In UI-Router (AngularJs ...
0
votes
1answer
24 views
How to clear everything from the view when changing to new route in angular2?
So I have a set of navigation buttons, when a user clicks on any of the navigation, they are directed to another page, but the view of the previous page is shown with the view of the new page that the ...
0
votes
1answer
42 views
Angular ui-router 2
I am trying to implement some multiple views as described in the link but cannot get this working. Here is what I do
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } ...
0
votes
1answer
31 views
How is the spa routing of angular2 working without the hash character in the url?
When performing the angular2 "Tour of Heros" tutorial, I just noticed their spa router works without a trailing hash (#) character in the url (like kendo spa router does for instance).
How does ...
0
votes
0answers
26 views
Can I create Angular2 web app with out having app.module.ts ?
I have created angular 2 web app given on official web site but with out using any app.module. But I am stuck now while implementing routing modules in my demo app. I don't know how to implement ...
0
votes
1answer
15 views
How to remove parenthesis in URL when using child/ auxiliary routes (named routers) in Angular2?
I am using named routers in my application to implement routing in one of the shared modules.
This is what configuration looks like in AppRoutingModule (root):
const routes: Routes = [
{
...
0
votes
0answers
81 views
Cannot find module at webpackEmptyContext when change route
I have multi angular application. ui-router in angular 1 used required to get html template and controller. Now after bootstrapping with UpgradeModule when i use require or System.import when try to ...
0
votes
2answers
105 views
Angular2 - Calling function 'UIRouterModule', function calls are not supported
I'm new in Angular2.
This error I'm getting when I import UIRouterModule, referring this
ERROR in Error encountered resolving symbol values statically. Calling function 'UIRouterModule', function ...
1
vote
1answer
38 views
Using Angular 2 RC5 router, how can I navigate, given an ActivatedRouteSnapshot?
Use Case
The user can access certain parts of my site without being logged in. If they click a download button and are logged in, the download starts automatically. However, if they click the ...
2
votes
0answers
31 views
Handle children item using tab
I have a page with a principal menu that contains a Notification item. When I click on that item, it open another breadcrumbs menu underneath that hold two item: send and status.
I want to be able ...
0
votes
2answers
37 views
Routes When Importing Not Working
I am currently attempting to add routing to my Angular 2 project. All of the components work, but when I add 'appRoutes' to my imports on app.module.ts , an error gets thrown saying
Uncaught ...
0
votes
0answers
34 views
How to create Angular2 library with multiple routes?
I'm pretty new to Angular2 and I have a requirement to build a reusable library which will be consumed by multiple applications as a html tag.
This reusable library will have multiple pages like ...
2
votes
0answers
76 views
Routing in angular 2
I have a Client folder. In the Client folder, i have a modal form file for adding. In the same Client folder, i have a table.html file. Now in the table.html file, i have fa fa-plus button. How can i ...
2
votes
1answer
157 views
What is the equivalent of $rootScope.$on('$stateChangeStart', ..) in ui-router for Angular 2?
I have experience with ui-router for Angular 1 and now I want to know how to listen $stateChangeStart in ui-router-ng2.
Please let me know how the following Angular 1 piece of code can be done in ...
0
votes
0answers
52 views
$auth.isAuthenticated is not a function
I'm using laravel-angular material starter and I'm encountering an error when going to /#!/home/ when I enabled data {auth:true} on the routes.config.js. The error is $auth.isAuthenticated is not a ...
0
votes
0answers
34 views
Angular2: “Rewrite” ActivatedRoute to different Component
I would like to have several components for the same route depending on some internal state.
From what I read so far, I should write my own RouterOutlet and modify the "activate" method.
Given the ...
0
votes
1answer
90 views
Parameters in Angular2 ui-router
I work with angular2 and ui-router (https://ui-router.github.io/docs/latest/modules/ng2.html).
I use the stateService in order to move from a state to another in typescript code.
How can i get passed ...
2
votes
1answer
220 views
Capture redirect route with guard in Angular2
I'm having trouble capturing the original navigating route using a guard in Angular 2.
My site consists of a core module protected by an authorization guard, and a login page that's unprotected.
The ...
1
vote
1answer
24 views
Why content gets populated as a sibling of router outlet in angular2
In ngRoute/ui.router, content gets loaded inside ng-view/ui-view, but in angular 2 it gets loaded as a sibling of router outlet. Why?
0
votes
1answer
90 views
ngUpgrade - routing from ng2 to ng1 - how?
I am using ngUpgrade and I dont know how to handle the routing between ng2 and ng1. If I am in ng2 component, how do I route to ng1 controller? and viceversa.
I am using ui-router for the ng1. For ...
0
votes
1answer
142 views
How to read $stateParms value in Angular2?
Using Ui-Router
In Angular1 The stateparam value is coming using $state.params
How to do the same thing in ANgular2
I tried like this this._uiRouter.globals.params.id
it's working, But its not a ...
0
votes
2answers
40 views
how to pass parameters from one state to other using angular2 ui router form ts code?
I am new to Angular2 . I tried quickstart application.same application now I want to do with angular2 ui router,I am struckking here
I have some list Items. When I click one Item it shows details of ...
13
votes
1answer
917 views
How to implement RouteReuseStrategy shouldDetach for specific routes in Angular 2
I have an Angular 2 module in which I have implemented routing and would like the states stored when navigating.
The user should be able to:
1. search for documents using a searchformula
2. navigate ...
12
votes
1answer
246 views
Change-detection not working properly in ng2 component after navigation via angular1 ui-router
In an application that uses ng-upgrade to use some new ng2 (V2.2.4) components inside a big ng1 (V1.5.9) app (using ui-router) I am currently seeing a very strange change-detection issue. As far as I ...
1
vote
1answer
49 views
Keeping the Angular2 router's hands off of the browser's address bar
I'm building a single-page Angular 2.2.0 application which will be part of an embedded website. The site will have half a dozen pages, with the Angular SPA at /application.html. The application will ...
4
votes
2answers
147 views
How to update matrix parameters in Angular2
In Angular2, is there a way to update a matrix parameter, but navigate to the same component? Basically would like to transition easily from a url that looks like:
/search;term=paris;pageSize=24;...
1
vote
3answers
28 views
Styling Angular 2 Psuedo Elements (directive elements?)
I'm trying to horizontally center an element that is a child of the router-outlet, but it's not working. I think a parent of a centered element needs to have a physical width so the child has ...
0
votes
0answers
17 views
Can I run a function when user either refreshes or exits url [duplicate]
When the user navigates away from the page I would like to run a function that will initialize anything that was changed in the database before the user leaves. Right now it is just taking up space ...
0
votes
2answers
34 views
Injecting resolve in child state
I'm trying to inject api into child state. My state definition looks as below.
To clarify a bit more. "api" should be the value resolved in the abstract named "root". I want to use that value in my ...
0
votes
0answers
80 views
how to get one component from another module angular2
In angular 2 how to import specific component from other module
In home.module.ts appComponent i need exports and import to other module tranfer.module.ts
After import homeModule when click tranfer ...
1
vote
1answer
443 views
Angular2 : Multiple Router-Outlets & Router-Outlets Inside Child Route
I have created an application containing a left-navigation (containing "User Management", "Vehicle Management" and "Administration").
The routing to go to the respective Components currently works as ...
1
vote
1answer
40 views
Legacy Meteor Methods angular2 UI Router Issue
https://github.com/faizmh/meteor_angular2_router_issues
I am trying to navigate from home page to market page.
In home page, I tried different variations to transition to market page
My target ...
1
vote
1answer
208 views
Angular 2 - Child route
Got a problem with angular 2 routing, i try lots of things but i still have error message.
I got this url : /project/:projectId . Project page got router-outlet and can have access to this two urls:
/...
0
votes
1answer
95 views
Angular2 nested module routing with same routes
I'm facing a common problem in a backend app.
I got several ressources which can be viewed by consulting this kind of routes:
reports/view/:id
campains/view/:id
suts/view/:id
certifications/view/:...
2
votes
0answers
434 views
How to fix this error The selector “app-component” did not match any elements in angular 2.0 application
I am getting an error in browser console when I click on the browser refresh button after running my Angular 2 application. It doesn't stop Angular 2 routing from one component to the other. Aside ...
5
votes
1answer
144 views
How can I prevent persistent URL anchor link hash values with UI-Router?
I'm using Angular2 and UI-Router 2 in no-hash mode for a simple app with some anchor links in the menu. For example:
https://example.com/blah/blech
https://example.com/blah/blech#specifications
https:...
1
vote
2answers
26 views
Is it possible to load a routerOutlet from a function in angular2
I want to load a routerOutles in angular2 without a button, but can't figure out how to do it. This is how to do it with a button:
<button (click) = "load()" ><a routerLink="/next" ...
0
votes
2answers
184 views
Protecting views, authentication or canActivate for Angular 2 with ui-router
I thought I could try using ui-router with Angular 2.
Currently, I already have some default angular2-router configuration, which mostly comes down to something like:
export const homeRoute: Route = ...
0
votes
1answer
147 views
How to redirect from NgOnInit?
I want to redirect, under certain conditions, when the page is loaded or before. For example, Cookies have to have something, then do a redirect.
this.router.navigate(["details"]); in AppComponent....
1
vote
1answer
104 views
Angular 2 wrapper project
I have to develop an angular 2 application which is the wrapper of other angular 2 applications.
Lets say the main Module of project is called MainModule
Other 3rd party modules which are deployed in ...