zoukankan      html  css  js  c++  java
  • angular4 开发记录

    1,传值问题

    page setValue:  [routerLink]="['/product-details', product.id]">  

    ts     seValue:    this.router.navigate(['/product-details', id]);

    ts     getVaue:    

    constructor(private route: ActivatedRoute) {}
    export class LoanDetailsPage implements OnInit, OnDestroy {
    id: number;
    private sub: any;
    constructor(private route: ActivatedRoute) {}
    ngOnInit() {
    this.sub = this.route.params.subscribe(params => {
    this.id = +params['id']; // (+) converts string 'id' to a number

    // In a real app: dispatch action to load the details here.
    });
    }
    ngOnDestroy() {
    this.sub.unsubscribe();
    }
    }

    2,model

    export class Gundam{
    id:number;
    name:String;
    }

    import {Gundam} form '../model/gundam';
    export class GUNDAMS:Gundam[]=[]

  • 相关阅读:
    LeetCode 21. 合并两个有序链表
    LeetCode 20. 有效的括号
    LeetCode 19. 删除链表的倒数第N个节点
    AI
    http
    IP地址
    wiodows /linux CMD
    git
    AI
    JS常用的获取值和设值的方法
  • 原文地址:https://www.cnblogs.com/jayruan/p/7147981.html
Copyright © 2011-2022 走看看