angular-routing

Angular 2.0 Router.navigate not redirecting after login

泄露秘密 提交于 2019-12-24 05:56:40
问题 I have a simple application connected up to firebase. On login, I simply want to redirect the user to their profile page. However, for some odd reason the redirect is not happening. I have look here which sounds like a similar problem, but unfortunately, no solution there. Changing the redirect to another page (one which does not have an auth guard) seems to work, so I guess the problem is there, I just don't know how to fix it. Here is my code, once the user signs in it calls my service:

How to use data-ng-view in _layout.cshtml

不想你离开。 提交于 2019-12-24 05:13:10
问题 I am trying to crate a MVC application with Angular. My application has common Header and footer. So I added it in _layout.cshtml. There are some static pages in the application. Hence I want to load this using Angular routing. Here is my _layout.cshtml <!DOCTYPE html> <html data-ng-app="HappyHut"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>@ViewBag.Title - My ASP.NET Application</title> @Styles.Render("~/Content/css")

How to use data-ng-view in _layout.cshtml

心已入冬 提交于 2019-12-24 05:12:07
问题 I am trying to crate a MVC application with Angular. My application has common Header and footer. So I added it in _layout.cshtml. There are some static pages in the application. Hence I want to load this using Angular routing. Here is my _layout.cshtml <!DOCTYPE html> <html data-ng-app="HappyHut"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>@ViewBag.Title - My ASP.NET Application</title> @Styles.Render("~/Content/css")

Not able to Use Resolve in Angular 2

徘徊边缘 提交于 2019-12-24 01:47:46
问题 I want to load object before the view is rendered in angular4, so i choose to use resolve of angular4 but i am not able to get data, dont know what am i doing wrong. this is my module import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { FormsModule } from '@angular/forms'; import { AppComponent } from './app.component'; import { ActivatedRoute, Routes, RouterModule } from '@angular/router'; import { ResolverService } from './resolver

unable to test Routing using RouterTestingModule

亡梦爱人 提交于 2019-12-24 00:36:11
问题 I have a component which uses Routes . I want to unit test the routes but am unale to do so using RouterTestingModule . The spec I have written is import {async, ComponentFixture, fakeAsync, TestBed, tick} from '@angular/core/testing'; .... fdescribe('HomepageContentComponentComponent', () => { let component: HomepageContentComponentComponent; let fixture: ComponentFixture<HomepageContentComponentComponent>; beforeEach(() => { TestBed.configureTestingModule({ imports:[ RouterTestingModule

Angular4: passing breadcrumb view components through the router's `data` property

狂风中的少年 提交于 2019-12-23 18:51:20
问题 In my Angular (v4) app, I'm trying to create a breadcrumb module. I found this S.O. question helpful, suggesting I store breadcrumb information in the router's data property like so { path: '', component: HomeComponent, data: {breadcrumb: 'home'}} But what I'd like to do is store a component in the data property, and then have the breadcrumb module extract and render it. Allowing me to interact with the breadcrumb module like this { path: '', component: HomeComponent, data: {breadcrumb:

SVG pattern not working in Safari

大城市里の小女人 提交于 2019-12-23 11:58:41
问题 I am trying to make a grid-like pattern using SVG. I am seeing really weird behavior with <router-outlet> , when I use this code via route (say localhost/test) then it fails to load pattern in Safari but using the selector of the component it works perfectly. <defs> <pattern id="pattern" width="10" height="10"> <path d="M10,0 L10,10 L0,10" fill="none" stroke="#E9E9E9" stroke-width="1"/> </pattern> </defs> <rect id="test" x="10" y="10" width="250" height="250" style="fill: url('#pattern');"/>

Angularjs ngRoute is not working in firefox [duplicate]

最后都变了- 提交于 2019-12-23 06:16:15
问题 This question already has an answer here : AngularJS - ui.router not working when using Firefox and crome v.49 [closed] (1 answer) Closed 3 years ago . <script> var app = angular.module('singlepageapp', ['ngRoute']) app.config(['$routeProvider', function ($routeProvider) { $routeProvider .when('/About', { templateUrl: 'DistrictMaps/About.aspx', }) .when('/Ch', { templateUrl: 'DistrictMaps/Ch.aspx', }) }]); app.run(function ($rootScope) { $rootScope.$on('$viewContentLoaded', function () { $(

Angularjs ngRoute is not working in firefox [duplicate]

て烟熏妆下的殇ゞ 提交于 2019-12-23 06:15:35
问题 This question already has an answer here : AngularJS - ui.router not working when using Firefox and crome v.49 [closed] (1 answer) Closed 3 years ago . <script> var app = angular.module('singlepageapp', ['ngRoute']) app.config(['$routeProvider', function ($routeProvider) { $routeProvider .when('/About', { templateUrl: 'DistrictMaps/About.aspx', }) .when('/Ch', { templateUrl: 'DistrictMaps/Ch.aspx', }) }]); app.run(function ($rootScope) { $rootScope.$on('$viewContentLoaded', function () { $(

Why this is not loading view1.cshtml in MVC empty web application ANGULAR

北城余情 提交于 2019-12-23 06:13:06
问题 I am learning Angular. I am watching a 2 years old video, and I am trying to use route concept and using in view1.CShtml (Remember, its CShtml and not html, while in the video, he uses html). I also find it wierd that Views path starts as ~Views/View1.cshtml (Fair enough I have it in Views folder) on contrary to Partial/View1 where the video demonstrator has. Now, I do not understand what is this "~" for when I have similar directory structure like demonstrator. Also, sadly, the view1 is not