-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Description
(Was originally opened here: angular/angular#15866)
I'm submitting a ... (check one with "x")
[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
Webpack (or Typescript) seems to strip static methods on inheritance. I'm posting here because the problem manifests in the context of Angular.
We're using angularfire2
, and more specifically FirebaseListObservable
.
FirebaseListObservable extends Observable
, so FirebaseListObservable
should have the static function of
.
However, when I do ng serve
I get the following error:
__WEBPACK_IMPORTED_MODULE_1_angularfire2__.a.of is not a function
at AppComponent.webpackJsonp.132.AppComponent.ngOnInit
Expected behavior
Looking through angularfire2
's code for FirebaseListObservable, they extend Observable like expected, and thus of
should be available. So I'm not thinking it's their problem?
Minimal reproduction of the problem with instructions
ng new bug
npm install angularfire2 --save
npm install firebase --save
npm install rxjs --save
app.component.ts:
import { Component, OnInit } from '@angular/core';
import { FirebaseListObservable } from 'angularfire2';
import { Observable } from 'rxjs';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
title = 'app works!';
ngOnInit() {
FirebaseListObservable.of({}).subscribe();
}
}
ng serve --open
Please tell us about your environment:
-
Angular version: 4.0.1
-
Browser: [all]
-
Language: TypeScript 2.2.2
-
Node (for AoT issues):
node --version
= 7.8.0