angular-routing

How to prevent view redraw when changing route in AngularJS

﹥>﹥吖頭↗ 提交于 2019-12-09 13:23:18
问题 I'm making a web app where users can view objects on a map, press a marker and go to a new view with information. From that view they can traverse deeper, into more information. Something like: /map /tree/{treeid} /tree/{treeid}/information/{informationid} I know how to keep the actual model state when traversing between routes/states. The problem is that I don't want to recalculate the entire map (with markers and everything) when I go back in the browser history. In other words, I want to

AngularJS, using routes without refreshes on back button

夙愿已清 提交于 2019-12-09 09:10:26
问题 I'm using angularJS to build a simple single page application using AJAX, but I'm running into a problem when users use the native back button. angular.module('myApp', ['ionic', 'myApp.controllers', myApp.services]) .config(function ($routeProvider, $locationProvider) { $routeProvider.when('/home', { templateUrl: 'templates/feed.html', controller: 'MenuCtrl', reloadOnSearch: false }); $routeProvider.when('/checkin/view/:id', { templateUrl: 'templates/checkin.html', controller: 'MenuCtrl' });

Angular 7 routerLink directive warning 'Navigation triggered outside Angular zone'

[亡魂溺海] 提交于 2019-12-09 07:58:59
问题 I am struggling with Angular framework to get my application run smoothly, but I can't resolve an issue with routing. I have a top level AppComponent and app-routing.module.ts which manage the navigation via my custom SlideMenuComponent . My simplified html template of AppComponent : <app-slide-menu [buttons]="menuButtons"></app-slide-menu> <router-outlet></router-outlet> My SlideMenuComponent has the following html as its core: <nav><div *ngFor="let button of buttons"> <a routerLink="{

Still getting 'Not Found' when manually refreshing with angular.js route

放肆的年华 提交于 2019-12-09 03:29:23
问题 After reading a ton of write-ups and stackoverflow questions on Angular.js route, I'm still getting the 'Not Found' error when I do a manual refresh. Steps: browse to localhost --> because of my configuration (below), I'm taken to localhost/home . Views and everything load fine. hit refresh in the browser --> browser displays this Not Found: the requested /home is not found on this server This question is probably most like Refreshing page gives "Page not found" My configuration // Routing

Why setting $window.location.href does not work when set inside a promise?

吃可爱长大的小学妹 提交于 2019-12-08 16:12:30
问题 I send request to the server and want conditionally redirect to another page (not angular) after response is received. Thus navigation happens inside then part of a promise. I tried: $location.path(url) and $window.location.href = url; $windo.location.reload(); nothing works. But if I wrap either of these two calls with setTimeout(navigate,0) redirection occurs. Seems like Angular guards url during digest cycle. Can anyone clarify or share the links explaining what really happens. 回答1: After

Angular Force load of same route

本小妞迷上赌 提交于 2019-12-08 14:15:45
问题 I have a route that goes to a calculator. The person might hit calculate and the screen shows the result. Which is fine. They then may go up to the navbar and click the same calculator again, by that I mean they are clicking the same route. I would like to screen to re-route so they are in essence starting over, refreshing the screen. Of course the route does not change nor does the screen change because they are on the same route. Is there some way to force the route to re-load or refresh. I

Cannot navigate same route in Angular

女生的网名这么多〃 提交于 2019-12-08 14:03:33
问题 I have a List and Details component in my Angular 7 project and I can open the details of a record by clicking the link on the List page. However, if I refresh on the same Details page or open the same Details page via hyperlink (e.g. opening the same record on the List in a new tab), HTTP Error 404.0 - Not Found is encountered. My code is as shown below: routing.module.ts: const routes: Routes = [ { path: 'user', component: UserPanelComponent children: [ { path: 'dashboard', component:

AngularDart: “logical pages” and views are 1-to-1 or 1-to-many or what?

雨燕双飞 提交于 2019-12-08 07:05:08
问题 What is the relationship between an app's " logical pages " and views in AngularDart (or JS)? For example, in the context of the AngularDart tutorial Recipe Book example, I originally considered "view recipe" and "edit recipe" as logical pages (or as an app steady state as @pavelgj suggests). When I started working through the AngularDart tutorial I thought that a logical pages and Angular "views" were in one-to-one correspondence. But in Chapter 6, views are treated as part of a the index

Angular animate before routing

浪尽此生 提交于 2019-12-08 06:51:17
问题 In my current project I'm trying to get rid of Angular animations skipping when routing. In my template I have got different "widgets" with mat-card in a css-grid layout which I want to make appear and disappear smoothly. My animations in the child component (to which the route points to) are looking like animations: [ trigger('cardAnimation', [ state('void', style({ opacity: 0, transform: 'scale(0.5)' })), state('*', style({ opacity: 1, transform: 'scale(1)' })), transition('void => *',

Angular4 - Nested route with params

拥有回忆 提交于 2019-12-08 05:13:19
问题 I got a routing for my user profiles in Angular4 /* Frame Default */ { path: '', component: FrameDefaultComponent, children: [ {path: 'home', component: SiteHomeComponent}, {path: 'home/:page', component: SiteHomeComponent}, { path: 'user/:id', component: SiteUserProfileComponent, children: [ {path: '', redirectTo: 'home', pathMatch: 'full'}, {path: 'home', component: SiteUserProfileHomeComponent}, {path: 'about', component: SiteUserProfileAboutComponent} ] }, { path: 'user/settings',