How to use @angular/platform-webworker-dynamic - 10 common examples

To help you get started, we’ve selected a few @angular/platform-webworker-dynamic examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mgechev / getting-started-with-angular / app / ch8 / ts / todo_webworkers / background_app.ts View on Github external
completed: false
    });
  }
  toggleCompletion(todo: Todo) {
    todo.completed = !todo.completed;
  }
}

@NgModule({
  imports: [WorkerAppModule, FormsModule],
  declarations: [TodoList, InputBox, TodoApp],
  bootstrap: [TodoApp]
})
class AppModule {}

platformWorkerAppDynamic().bootstrapModule(AppModule)
  .catch(err => console.error(err));
github angular / angular / modules / playground / src / web_workers / images / background_index.ts View on Github external
*
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */

import {NgModule} from '@angular/core';
import {WorkerAppModule} from '@angular/platform-webworker';
import {platformWorkerAppDynamic} from '@angular/platform-webworker-dynamic';

import {ImageDemo} from './index_common';

@NgModule({imports: [WorkerAppModule], bootstrap: [ImageDemo], declarations: [ImageDemo]})
export class ExampleModule {
}

platformWorkerAppDynamic().bootstrapModule(ExampleModule);
github angular / angular / modules / playground / src / web_workers / router / background_index.ts View on Github external
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */

import {platformWorkerAppDynamic} from '@angular/platform-webworker-dynamic';
import {AppModule} from './index_common';

platformWorkerAppDynamic().bootstrapModule(AppModule);
github angular / angular / modules / playground / src / web_workers / todo / background_index.ts View on Github external
* Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */

import {NgModule} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {WorkerAppModule} from '@angular/platform-webworker';
import {platformWorkerAppDynamic} from '@angular/platform-webworker-dynamic';

import {TodoApp} from './index_common';

@NgModule({imports: [WorkerAppModule, FormsModule], bootstrap: [TodoApp], declarations: [TodoApp]})
export class ExampleModule {
}

platformWorkerAppDynamic().bootstrapModule(ExampleModule);
github angular / angular / modules / playground / src / web_workers / animations / background_index.ts View on Github external
*
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */

import {NgModule} from '@angular/core';
import {WorkerAppModule} from '@angular/platform-webworker';
import {platformWorkerAppDynamic} from '@angular/platform-webworker-dynamic';

import {AnimationCmp} from './index_common';

@NgModule({imports: [WorkerAppModule], bootstrap: [AnimationCmp], declarations: [AnimationCmp]})
export class ExampleModule {
}

platformWorkerAppDynamic().bootstrapModule(ExampleModule);
github kaikcreator / webWorkerFactorialExample / src / workerLoader.ts View on Github external
import './polyfills.ts';
import '@angular/core';
import '@angular/common';

import {platformWorkerAppDynamic} from '@angular/platform-webworker-dynamic';
import { AppModule } from './app/';

platformWorkerAppDynamic().bootstrapModule(AppModule);
github angular / angular / modules / playground / src / web_workers / message_broker / background_index.ts View on Github external
*
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */

import {NgModule} from '@angular/core';
import {WorkerAppModule} from '@angular/platform-webworker';
import {platformWorkerAppDynamic} from '@angular/platform-webworker-dynamic';

import {App} from './index_common';

@NgModule({imports: [WorkerAppModule], bootstrap: [App], declarations: [App]})
export class ExampleModule {
}

platformWorkerAppDynamic().bootstrapModule(ExampleModule);
github thelgevold / angular-samples / src / apps / shared-components / web-workers / factorial / web-worker-app.ts View on Github external
}

  private calculate(val: string) {
    if(val) {
      let result = factorial(parseInt(val));
      return Promise.resolve(result);
    }
    return Promise.resolve('');
  }
}

@NgModule({imports: [WorkerAppModule], bootstrap: [Worker], declarations: [Worker]})
class WorkerModule {
}

platformWorkerAppDynamic().bootstrapModule(WorkerModule);

function factorial(num) {

  if (num === 0) {
    return 1;
  }
  else {
    return (num * factorial(num - 1));
  }
}
github angular / angular / modules / playground / src / web_workers / input / background_index.ts View on Github external
*
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */

import {NgModule} from '@angular/core';
import {WorkerAppModule} from '@angular/platform-webworker';
import {platformWorkerAppDynamic} from '@angular/platform-webworker-dynamic';

import {InputCmp} from './index_common';

@NgModule({imports: [WorkerAppModule], bootstrap: [InputCmp], declarations: [InputCmp]})
export class ExampleModule {
}

platformWorkerAppDynamic().bootstrapModule(ExampleModule);
github angular / angular / modules / playground / src / web_workers / kitchen_sink / background_index.ts View on Github external
import {NgModule} from '@angular/core';
import {WorkerAppModule} from '@angular/platform-webworker';
import {platformWorkerAppDynamic} from '@angular/platform-webworker-dynamic';

import {HelloCmp, RedDec} from './index_common';

@NgModule({
  imports: [WorkerAppModule],
  bootstrap: [HelloCmp],
  declarations: [HelloCmp, RedDec],
})
export class ExampleModule {
}

platformWorkerAppDynamic().bootstrapModule(ExampleModule);

@angular/platform-webworker-dynamic

Angular - library for using Angular in a web browser with web workers

MIT
Latest version published 4 years ago

Package Health Score

73 / 100
Full package analysis

Popular @angular/platform-webworker-dynamic functions

Similar packages