Article import 'rxjs/add/operator/filter'; import 'rxjs/add/operator/map'; import 'rxjs/add/operator/mergeMap'; import { Component, OnInit } from '@angular/core'; import { Router, NavigationEnd, ActivatedRoute } from '@angular/router'; import { Title…
In this tutorial we are going to learn how to navigate programmatically (or imperatively) by using the Router API. We are going to learn how to use the function navigateByUrl to navigate using a manually constructed string, but we are also going to l…
1 page title </head>    contains information about the page </title> the title of the document…
Page title: <?php echo CHtml::encode(iconv('gbk','utf-8',$this->pageTitle)); ?> CMenu: framework/zii/widgets/CMenu.php, in function "normalizeItems", add this row: $item['label'] = iconv('gbk','utf-8',$item['label'])   in this block: fo…
Angular2以组件化的视角来看待web应用,使用Angular2开发的web应用,就是一棵组件树.组件大致分为两类:一类是如list.table这种通放之四海而皆准的通用组件,一类是专为业务开发的业务组件.实际开发中大部分时间我们都需要处理业务组件.对于SPA应用来说,一个通用的问题就是如何控制页面的切换,解决这个问题的通用方法就是利用路由器来实现. 路由配置 现在我们先撇开Angular2来看看通用的路由器模型.通常来讲SPA应用需要路由配置信息: [ { path: '', pathMa…
If you’ve created several Routes within your application, you will also want to be able to navigate between them. React Router supplies a Link component that you will use to make this happen. Import Link: import { BrowserRouter as Router, Route, Link…
参考 : https://angular.cn/docs/ts/latest/guide/router.html#!#can-activate-guard https://angular.cn/docs/ts/latest/api/    -@angular/router 部分 ng2 路由的概念和游览器类似, 和 ui-router 也类似, 下面会把具体功能逐一解释 1. html5 和 hash # ng2 默认模式是 html5, 在开发阶段我们喜欢使用 hash 模式, 这样可以不用部…
Article Github Auxiliary Routes is is little bit hard to understand. Here is demo, link You can see each category has an own 'View detials' button, and there is a side menu on the right side. What we want is when we click the "View details" butt…
In this tutorial we are going to learn how to use the Angular 2 router to pass optional query parameters from one route into another route. There are couple of ways of doing this from the source route perspective: we use the queryParams property in t…
Index router as default router. import {RouterModule} from "@angular/router"; import {NotFoundComponent} from "./shared-components/not-found/not-found.component"; const indexRoute = {path: '', redirectTo: 'home', pathMatch: 'full'}; co…