A new router for Angular 1.4 and 2.0 using components
Questions tagged [angularjs-new-router]
13 questions
8
votes
2 answers
Angular 2 - equivalent to router resolve data for new router
I am playing with Angular 2.0's new router and I try to use something similar to Angular 1.X ui-router / ng-route resolve mechanism.
I was trying to achieve this using RouteData:
import {Component, ViewEncapsulation} from 'angular2/core';
import {
…

Yaniv Efraim
- 6,633
- 7
- 53
- 96
5
votes
1 answer
Could not instantiate controller Angular New Router
I'm using the new Angular router for 1.4 and it throws me an error when doing a simple controller for a component:
angular.module('app.campaigns',['security', 'ngNewRouter'])
.controller('CampaignsController', ['authService', '$rootScope',…

Alexandru R
- 8,560
- 16
- 64
- 98
4
votes
0 answers
Angular New Router doesn't load template on page refresh, controller works
I have the following:
function AppController ($router, authService) {
$router.config ([
{ path: '/', redirectTo: '/home' },
{ path: '/home', components: {'main' : 'home' }},
{ path: '/account', components: {'main' : 'account'…

Alexandru R
- 8,560
- 16
- 64
- 98
3
votes
0 answers
How do I write angular-ui-router code to ensure maximum compatibilty to new angular router?
For a large application I have to re-design the navigation and routing concept.
As far as I see, the new angular router, which was announced for 1.4 (and 2.0) is still not production ready. All the information I found about the new router sounds…

westor
- 1,426
- 1
- 18
- 35
3
votes
1 answer
How can I nest viewports with the new Angular router?
I have the new Angular router (Angular 1.4) working for the unnested routes and viewports. I cannot get it to work when a nested component has a viewport of its own. I've read through all the tutorials I could find and none of them discuss…

guyja
- 857
- 1
- 10
- 19
2
votes
0 answers
AngularJS New Router - Multiple Viewports route parameter is not working
My SPA uses the new angular router. Everything is working well, but now I would like to pass a parameter to one of the components. There are multiple viewports in every routing, and in this case I can't grab the parameter passed to the router.
The…

MontyX
- 129
- 1
- 1
- 10
2
votes
0 answers
1.4 + New Router: Default components?
Using the new router and Angular 1.4, is it possible to define the default component for a particular viewport? For instance, my side and top navs are components and currently I have to define every route like this:
$router.config([
{
…

Matt Holmes
- 1,055
- 1
- 8
- 22
1
vote
1 answer
AngularJS 1.4 ngNewRouter - How to use partial views?
I'm working on a project where I need to use the AngularJS 1.4.3.
The problem is that I have to use the new routing of course, but on a view I need to use another partial views.
E.g.
I have a Home view, and this contains 2 dynamic table generated by…

MontyX
- 129
- 1
- 1
- 10
1
vote
0 answers
AngularJS lazy loading components with ngNewRoute
I want to make an application that uses AngularJS new router. I decided to wrap every component to a new module and lazily load the component (module, controller and template) with ocLazyLoad when user changed the route to that component. I think I…

alisabzevari
- 8,008
- 6
- 43
- 67
1
vote
1 answer
How to $emit events from Angular 1.4 new router components to parent controller?
In new angular components, $scope cannot be injected so I can't use the standard $emit.
How to I emit a value from a component to parent controller?
I have this in appCtrl:
$scope.$on('eventName', function (event, args) {
this.pageTitle =…

Alexandru R
- 8,560
- 16
- 64
- 98
1
vote
1 answer
How to change templates for Angular 1.4 New Router based on dynamic params?
I have the following $router configuration
$router.config ([
{ path: '/account/profile', components: {'main' : 'accountProfile' }},
{ path: '/campaigns/:type', components: {'main' : 'campaigns' }},
{ path: '/login', components:…

Alexandru R
- 8,560
- 16
- 64
- 98
1
vote
0 answers
Initialize Angular 1.4 app with ngNewRouter with asynchronous data
I know about this question here: AngularJS : Initialize service with asynchronous data which I have used in the past on 1.1 and 1.2.
But this requires you need to use old ngRoute module. I'm using ngNewRouter (available for angular 1.x) and don't…

Alexandru R
- 8,560
- 16
- 64
- 98
0
votes
1 answer
How to bind to "this" in Angular 1.4 new router Components, instead of using local vars?
I have a components controller and in order to use this inside local functions I have to declare a local var.
Is there a better way to bind to "this" inside new angular router?
For example this function:
function appController ($router, $scope,…

Alexandru R
- 8,560
- 16
- 64
- 98