Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

angular-aurelia-adapter

erwinverdonk93MIT1.0.5TypeScript support: included

Adapter to use Angular components and code inside an Aurelia project.

readme

angular-aurelia-adapter

Adapter to use Angular components and code inside an Aurelia project.

Installation

  1. Install the plugin into your project using npm

    npm install angular-aurelia-adapter
  2. (Only when using Aurelia CLI) Add the NPM module as dependency to aurelia.json.

{
  "name": "angular-aurelia-adapter",
  "path": "../node_modules/angular-aurelia-adapter/dist",
  "main": "index"
}
  1. Import the plugin using the aurelia configuration object

    export function configure(aurelia) {
     aurelia.use
       .standardConfiguration()
       // Install the plugin
       .plugin('angular-aurelia-adapter');
     aurelia.start().then(_ => _.setRoot());
    }

Using the template adapter

Since the plugin is globalized, you can use it by placing a <angularjs> custom element in any of your views:

  <angularjs modules.bind="HelloWorld.id" controller.bind="HelloWorld.controller">
    <hello-world value="$ctrl.value"></hello-world>
  </angularjs>

Using the template compiler

import {AngularJSCompiler} from "angular-aurelia-adapter";

AngularJSCompiler
  .create(["yourModuleIDs"])
  .compile(this.elementToCompile, this.myController);

Using the injectable function invoker

import {AngularJSCompiler} from "angular-aurelia-adapter";

AngularJSCompiler
  .create(["yourModuleIDs"])
  .invoke(($location, $timeout) => {
    $timeout(_ => {
      $location.path("/newValue");
    }, 1000);
  });