angular-aurelia-adapter
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

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
  1. (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);
  });

Readme

Keywords

none

Package Sidebar

Install

npm i angular-aurelia-adapter

Weekly Downloads

2

Version

1.0.5

License

MIT

Last publish

Collaborators

  • erwinverdonk