
angular
提莫大大魔王
喵喵。。喵喵。。喵喵喵喵
展开
-
angular实现jsonp请求
1 、 引入 Http 、Jsonp 、RxJs 模块import {Http,Jsonp} from "@angular/http";import {Observable} from "rxjs";import "rxjs/Rx";2 、 构造函数声明constructor(private http:Http,private jsonp:Jsonp) { }3、Jso...转载 2018-11-21 18:24:36 · 1955 阅读 · 0 评论 -
angular使用@input子组件获取父组件的数据和方法
1使用@input传递数据1、父组件使用自组件app-header传入msg数据。 <app-header [msg]="msg"></app-header>2、子组件引入 Input import { Component, OnInit ,Input } from '@angular/core';3、子组件中 @Input msg:string...原创 2018-11-22 16:49:22 · 4724 阅读 · 0 评论 -
angular使用@output子组件获取父组件的数据和方法
1、子组件引入 Output 和 EventEmitterimport { Component, OnInit ,Input,Output,EventEmitter} from '@angular/core';<app-header (outer)="runParent($event)"></app-header>2. 子组件中实例化 EventEmitt...原创 2018-11-22 17:12:31 · 2549 阅读 · 2 评论 -
angular使用@viewChild父组件获取子组件的数据和方法
一、 父组件通过局部变量获取子组件的引 用 ,主动获取子组件的数据和方法1、 使用#给子组件命名为#footer<app-footer #footer></app-footer>2、父组件直接获取执行子组件footer的方法<button (click)='footer.footerRun()'>获取子组件的数据</button>...原创 2018-11-24 09:35:01 · 5239 阅读 · 0 评论 -
angular的路由传值
1 在html页面设置地址 routerLink/参数值 2 在路由配置中 配置路由 path:'newsconpentent/:id,conponent:NewcontentConponent'3 在跳转到的页面中获取值:实际就是在路由的时候传个参数过去。在跳转的时候并没没有经过ts文件的逻辑处理。直接通过html中的路由地址跳转到相应的页...原创 2018-12-02 20:03:37 · 352 阅读 · 0 评论 -
angular路由的js跳转
js跳转:经过ts中的逻辑处理跳转到相应的界面。1、调用函数goNew() 跳转值相应的界面。2、路由配置和动态路由传值的方式相同原创 2018-12-02 20:33:32 · 495 阅读 · 0 评论 -
angular的js跳转使用get传值
1引入NavigationExtras,在逻辑处理中进行页面跳转。并传递参数3在目的页面通过router.queryParams来获取传过来的参数。原创 2018-12-02 20:41:11 · 414 阅读 · 0 评论 -
angular的父子路由
父子路由界面 12配置商品的父子路由 (html页面)2进行路由的配置原创 2018-12-02 21:02:27 · 507 阅读 · 0 评论