1.0.5 • Published 7 years ago
angular-aurelia-adapter v1.0.5
angular-aurelia-adapter
Adapter to use Angular components and code inside an Aurelia project.
Installation
Install the plugin into your project using npm
npm install angular-aurelia-adapter
(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"
}
Import the plugin using the
aurelia
configuration objectexport 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);
});