@ -12,10 +12,8 @@ const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/platform-browser': 'ng.platformBrowser',
|
||||
'rxjs/Subscription': 'Rx',
|
||||
'rxjs/Observable': 'Rx',
|
||||
'rxjs/observable/merge': 'Rx.Observable',
|
||||
'rxjs/operator/map': 'Rx.Observable.prototype'
|
||||
'rxjs': 'rxjs',
|
||||
'rxjs/operators': 'rxjs.operators'
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
|
@ -7,9 +7,8 @@
|
||||
*/
|
||||
|
||||
import {ApplicationRef, ComponentFactory, ComponentFactoryResolver, ComponentRef, EventEmitter, Injector, OnChanges, SimpleChange, SimpleChanges, Type} from '@angular/core';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {merge} from 'rxjs/observable/merge';
|
||||
import {map} from 'rxjs/operator/map';
|
||||
import {Observable, merge} from 'rxjs';
|
||||
import {map} from 'rxjs/operators';
|
||||
|
||||
import {NgElementStrategy, NgElementStrategyEvent, NgElementStrategyFactory} from './element-strategy';
|
||||
import {extractProjectableNodes} from './extract-projectable-nodes';
|
||||
@ -180,7 +179,7 @@ export class ComponentNgElementStrategy implements NgElementStrategy {
|
||||
protected initializeOutputs(): void {
|
||||
const eventEmitters = this.componentFactory.outputs.map(({propName, templateName}) => {
|
||||
const emitter = (this.componentRef !.instance as any)[propName] as EventEmitter<any>;
|
||||
return map.call(emitter, (value: any) => ({name: templateName, value}));
|
||||
return emitter.pipe(map((value: any) => ({name: templateName, value})));
|
||||
});
|
||||
|
||||
this.events = merge(...eventEmitters);
|
||||
|
@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import {Injector, Type} from '@angular/core';
|
||||
import {Subscription} from 'rxjs/Subscription';
|
||||
import {Subscription} from 'rxjs';
|
||||
|
||||
import {ComponentNgElementStrategyFactory} from './component-factory-strategy';
|
||||
import {NgElementStrategy, NgElementStrategyFactory} from './element-strategy';
|
||||
|
@ -6,7 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import {ComponentFactory, Injector} from '@angular/core';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {Observable} from 'rxjs';
|
||||
|
||||
/**
|
||||
* Interface for the events emitted through the NgElementStrategy.
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
import {ComponentFactory, ComponentRef, Injector, NgModuleRef, SimpleChange, SimpleChanges, Type} from '@angular/core';
|
||||
import {fakeAsync, tick} from '@angular/core/testing';
|
||||
import {Subject} from 'rxjs/Subject';
|
||||
import {Subject} from 'rxjs';
|
||||
|
||||
import {ComponentNgElementStrategy, ComponentNgElementStrategyFactory} from '../src/component-factory-strategy';
|
||||
import {NgElementStrategyEvent} from '../src/element-strategy';
|
||||
|
@ -9,7 +9,7 @@
|
||||
import {Component, EventEmitter, Injector, Input, NgModule, Output, destroyPlatform} from '@angular/core';
|
||||
import {BrowserModule} from '@angular/platform-browser';
|
||||
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
|
||||
import {Subject} from 'rxjs/Subject';
|
||||
import {Subject} from 'rxjs';
|
||||
|
||||
import {NgElementConstructor, createCustomElement} from '../src/create-custom-element';
|
||||
import {NgElementStrategy, NgElementStrategyEvent, NgElementStrategyFactory} from '../src/element-strategy';
|
||||
|
Reference in New Issue
Block a user