angular-routing

Angular : Error: Uncaught (in promise) at webpackAsyncContext (eval at ./src/$$_lazy_route_resource

流过昼夜 提交于 2019-11-28 21:07:41
I'm upgrading from Angular 4.0.0 to Angular 5.2.6 i'm facing some problem to get lazy module loading working. with angular 4.0.0 , it works fine , but now , with 5.2.6 , i getting such an error when clicking my redirecting button : core.js:1448 ERROR Error: Uncaught (in promise): TypeError: undefined is not a function TypeError: undefined is not a function at Array.map (<anonymous>) at webpackAsyncContext (eval at ./src/$$_lazy_route_resource lazy recursive (main.bundle.js:27), <anonymous>:13:34) at SystemJsNgModuleLoader.loadAndCompile (core.js:6558) at SystemJsNgModuleLoader.load (core.js

How to apply jquery after AngularJS partial template is loaded

流过昼夜 提交于 2019-11-28 17:56:33
I have a simple website that implements jQuery in order to create a Slider with some images in the Index.html top banner. Now, I want to use AngularJS so I'm breaking the HTML code into separate partials. Header Footer Top Banner If I run the Index.html in the original version (without applying AngularJS patterns) then I can see the slider working perfect. When applying AngularJS patterns, I moved the top banner HTML to a partial html and then applied ng-view to the div where the top banner is originally located. var app = angular.module('website', ['ngRoute']); app.config(function(

How to apply canActivate guard on all the routes?

邮差的信 提交于 2019-11-28 17:24:30
I have a angular2 active guard which handle if the user is not logged in, redirect it to login page: import { Injectable } from "@angular/core"; import { CanActivate , ActivatedRouteSnapshot, RouterStateSnapshot, Router} from "@angular/router"; import {Observable} from "rxjs"; import {TokenService} from "./token.service"; @Injectable() export class AuthenticationGuard implements CanActivate { constructor ( private router : Router, private token : TokenService ) { } /** * Check if the user is logged in before calling http * * @param route * @param state * @returns {boolean} */ canActivate (

Angular 8: pass a data to a router

久未见 提交于 2019-11-28 14:18:45
问题 I have page with a list of products, and I want to pass product id to a product/:id router (I don't want to parse it from router url). What options do I have? Can I have something like Input() to a router component? 回答1: Let me get this right first! You have a list of items and when you click on one, you need to redirect to a general route that displays the details in reference to the item id? You are looking for a way to pass the item id to the child component without passing it as a route

PathLocationStrategy works only locally

南楼画角 提交于 2019-11-28 13:56:35
I have problem with hash, on my working project when I build it, on test project all work correctly. I already read this questions in google: Angular2 without hash in the url https://forum.ionicframework.com/t/url-routing-without-hash/81140 but I didn't find answer. When I add {provide: LocationStrategy, useClass: HashLocationStrategy} All work correctly, but with hash. When I add {provide: LocationStrategy, useClass: PathLocationStrategy} It work only on local version. But working version don't work http://joxi.ru/n2YLOaMijK7Pam How can I remove this hash http://joxi.ru/RmzBzxDTWbjeQm what

Angular js scope var value in iframe

谁都会走 提交于 2019-11-28 12:24:30
I am working with angular js . I have a controller "youTubePlayerCtrl", in this controller i have $scope.videoID which contains the youtube video id. I am able to get this value in belows div in h1 block . but i am not able to get {{videoID}} in iframe, can any one help me how to fix this. <div ng-controller="youTubePlayerCtrl"> <h1>{{videoID}}</h1> <iframe class="youtube-player" type="text/html" width="auto" height="auto" src="http://www.youtube.com/embed/{{videoID}}" allowfullscreen frameborder="0"> </iframe> </div> This is the error log: [$interpolate:noconcat] http://errors.angularjs.org

Angular 2 router auxiliary routes not working on redirectTo

♀尐吖头ヾ 提交于 2019-11-28 09:27:23
问题 I recently started a new project based on angular 2.0.0 in combination with Angular Router (V3.0.0). Thereby I have issues with the auxiliary routes. I want to split up my application in different views that appear in every state like navigation bar, main content, footer etc. So that when the user interact with the site only the part of the page that needs to be changed (f.e. the content) is changed and all other views are left as they are. Therefore I wanted to use the routers auxiliary

Caching URL view/state with parameters

大兔子大兔子 提交于 2019-11-28 09:13:06
I'm making a mobile app using Cordova and AngularJS. Currently I have installed ui-router for routing but I'm open to any other alternative for routing. My desire: I want to cache certain views bound with parameters. In other words I want to cache paths (or pages). Example situation: let's say that we see some dashboard page, click on some book cover which redirects to the path book/2 . This path is being loaded for the first time into app. Router redirects from HomeController to BooksController (whatever the name). Now the BooksController loads data for given $stateParams (book id = 2) and

Getting Angular2 error 'No provider for Router! (RouterOutlet -> Router)'

核能气质少年 提交于 2019-11-28 08:05:46
I use Angular2 alpha39 and Babel to transpile the ES6 JS file. I'm not using typescript. I created a component which displays correctly. I added a router-outlet to the template. When I run the app, I get the error message: No provider for Router! (RouterOutlet -> Router) The call stack is: Here is the snippet of code: template: .... // Removed for brevity <div class="contenttext"> <router-outlet></router-outlet> </div> .... // Removed for brevity Component file: import { Component, View, bootstrap, OnInit } from 'angular2/angular2'; import { RouteConfig, RouterOutlet, RouterLink } from

Angular 2.0.1 Router EmptyError: no elements in sequence

二次信任 提交于 2019-11-28 08:00:47
问题 I'm having trouble getting Angular 2 routing to work. I am using Angular 2 and Webpack. In the Angular 2 webpack starter, I noticed they had webpack generating their html and their links, but I was hoping I would not have to webpack my html files. Here's my app.routes.ts... import { ModuleWithProviders } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { HomeComponent } from "./home/home.component"; import { ScheduleComponent } from "./schedule/schedule