This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const todoAngularElement = document.getElementsByTagName("todo-root-angular-element")[0]; | |
| if (todoAngularElement) { | |
| todoAngularElement.pushTodoItem(newTodo); | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Input() public pushTodoItem = todo => { | |
| this.ngZone.run(() => { | |
| this.todos.push(todo); | |
| }); | |
| }; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @NgModule({ | |
| imports: [BrowserModule, TodoModule], | |
| entryComponents: [TodoComponent] | |
| }) | |
| export class TodoWrapperModule { | |
| constructor(private injector: Injector) { | |
| const todoElement = createCustomElement(TodoComponent, { | |
| injector: this.injector | |
| }); | |
| customElements.define('todo-root-angular-element', todoElement); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div> | |
| <todo-root-angular-element class="todo-app" ng-on-add_todo_emitter="add($event)" ng-on-remove_todo_emitter="remove($event)"></todo-root-angular-element> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @NgModule({ | |
| imports: [BrowserModule, TodoModule], | |
| entryComponents: [TodoComponent] | |
| }) | |
| export class TodoWrapperModule { | |
| constructor(private injector: Injector) { | |
| const todoElement = createCustomElement(TodoComponent, { | |
| injector: this.injector | |
| }); | |
| customElements.define('todo-root-angular-element', todoElement); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { timer as observableTimer, Subscription, interval, of, concat, SchedulerLike, asyncScheduler, Observable } from 'rxjs'; | |
| import { takeWhile, tap, take, switchMap, repeat, retryWhen, scan, mapTo, expand, exhaustMap } from 'rxjs/operators'; | |
| import { Injectable, Inject } from '@angular/core'; | |
| import { HttpClient } from '@angular/common/http'; | |
| export interface IntervalBackoffConfig { | |
| initialInterval: number; | |
| maxInterval?: number; |