惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
WordPress大学
WordPress大学
Google DeepMind News
Google DeepMind News
T
The Exploit Database - CXSecurity.com
阮一峰的网络日志
阮一峰的网络日志
F
Fox-IT International blog
The GitHub Blog
The GitHub Blog
Engineering at Meta
Engineering at Meta
I
Intezer
P
Privacy & Cybersecurity Law Blog
B
Blog RSS Feed
Latest news
Latest news
小众软件
小众软件
A
Arctic Wolf
Attack and Defense Labs
Attack and Defense Labs
L
LINUX DO - 热门话题
博客园 - 聂微东
B
Blog
T
Troy Hunt's Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
Malwarebytes
Malwarebytes
爱范儿
爱范儿
Recorded Future
Recorded Future
Apple Machine Learning Research
Apple Machine Learning Research
人人都是产品经理
人人都是产品经理
D
Docker
T
Threat Research - Cisco Blogs
MyScale Blog
MyScale Blog
Martin Fowler
Martin Fowler
E
Exploit-DB.com RSS Feed
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
PCI Perspectives
PCI Perspectives
Scott Helme
Scott Helme
N
Netflix TechBlog - Medium
博客园 - 三生石上(FineUI控件)
T
True Tiger Recordings
C
Check Point Blog
Microsoft Azure Blog
Microsoft Azure Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
K
Kaspersky official blog
Security Latest
Security Latest
The Hacker News
The Hacker News
Microsoft Security Blog
Microsoft Security Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
Stack Overflow Blog
Stack Overflow Blog
S
Security @ Cisco Blogs
C
CXSECURITY Database RSS Feed - CXSecurity.com
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
M
Microsoft Research Blog - Microsoft Research

Ionic

有没有熟悉 Ionic 的 cordova/ionic App 实现微前端,求个最佳实践 有谁知道使用 ionic 框架的 APP 吗? ionic2.0@beta 版本文档 -转摘 中文教程哦 刚刚去 Ionic Framework 官方的 Showcase 试了一堆 Android app,感觉现在 Hybrid App 在 Android 上都好流畅,跟 3 年前参加比赛时相比感觉提升太多太多了 [求助] Ionic 安装不能: Error: EACCES: permission denied, uv_cwd ionic 使用百度地图 App 显示空白 哪位大神能发一个 ionic 利用百度地图 API 或者高德地图 API 定位获取当前位置的例子 Ionic+angularjs 传参数问题请教 能用 ionic 做手机站吗? ionic 如何从后台动态获取数据? 为什么 ionic 在浏览器和安卓上编译出的版本的布局不一样? Ionic 可以做到无视 CORS 吗 这个节点下的一血,当然要由我拿下
ionic 2 如何继承一个已经依赖注入 service 的基类?
gulullu · 2017-02-24 · via Ionic

基类:

import { LoginPage } from './../login/login/login';
import { AccountData } from './../../storages/account_data';
import { Component, Injectable } from '@angular/core';
import { NavController, NavParams, Platform, ViewController } from 'ionic-angular';
/*
  Generated class for the Base page.

  See http://ionicframework.com/docs/v2/components/#navigation for more info on
  Ionic pages and navigation.
*/

@Component({
  selector: 'page-base',
  templateUrl: 'base.html'
})
export abstract class BasePage {
  needLogin = false;

  constructor(protected accountData: AccountData, protected nav: NavController) { }

  push(page: any) {
    this.accountData.hasLoggedIn().subscribe(hasLoggedIn => {
      if (hasLoggedIn) {
        this.nav.push(page);
      } else {
        if (page.needLogin) {
          this.nav.push(LoginPage);
        } else {
          this.nav.push(page)
        }
      }
    });
  }

  pop() {
    this.nav.pop();
  }

  setRoot(page: any) {
    this.nav.setRoot(page);
  }
}

继承该基类的:

import { AccountData } from './../../storages/account_data';
import { BasePage } from './../base/base';
import { Component } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';

/*
  Generated class for the Discover page.

  See http://ionicframework.com/docs/v2/components/#navigation for more info on
  Ionic pages and navigation.
*/
@Component({
  selector: 'page-discover',
  templateUrl: 'discover.html'
})
export class DiscoverPage extends BasePage {

  constructor(protected accountData: AccountData, protected navCtrl: NavController, ) {
    super(accountData, navCtrl);
  }

}

运行ionic serve后报错: Uncaught TypeError: Object prototype may only be an Object or null: undefined at setPrototypeOf ()

但是如果父类的构造方法为空的话一切正常,求解。