gooy / aurelia-compiler Goto Github PK
View Code? Open in Web Editor NEWA compiler service that compiles an HTML element with aurelia behaviors.
License: MIT License
A compiler service that compiles an HTML element with aurelia behaviors.
License: MIT License
Getting TypeError: obj is undefined
with that code when adding row:
markdown.setAttribute('if.bind', 'test');
app.html:
<side-bar if.bind="state.showNav" navigation.bind="nav.tree"></side-bar>
side-bar.js
import {bindable, noView} from 'aurelia-framework';
import {Compiler} from 'gooy/aurelia-compiler';
@noView
export class SideBar {
static inject() {return [Compiler, Element]}
@bindable navigation = null;
test = true;
constructor(compiler, element){
this.compiler = compiler;
this.element = element;
}
activate(){
console.log("SideBar", "activate");
}
deactivate(){
console.log("SideBar", "deactivate");
}
bind(context) {
console.log("SideBar", "bind", this.navigation);
}
unbind() {
console.log("SideBar", "unbind");
}
attached() {
console.log("SideBar", "attached", this.navigation);
var markdown = document.createElement("div");
markdown.setAttribute('if.bind', 'test'); // triggers error
this.element.appendChild(markdown);
this.compiler.compile(markdown);
}
detached() {
console.log("SideBar", "detached");
}
}
When I import the compiler like this:
import {Compiler} from 'gooy/aurelia';
And then try to run that module in the browser, I get this error:
GET http://localhost:9000/dist/gooy/aurelia.js 404 (Not Found)
I have the following:
import {Compiler} from 'gooy/aurelia-compiler';
@autoinject
export class PopoverErrorRenderer extends ErrorRenderer {
compiler: Compiler;
constructor(compiler: Compiler) {
super();
this.compiler = compiler;
}
...
This generates a "badKeyError" in Dependency Injection.
Error: key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI? at Container.get [email protected]/aurelia-dependency-injection.js:473:15
Is this library meant to be used with the latest aurelia release? I had some trouble installing this plugin and I saw the note that "this library will be refactored and parts of it will be included into the core", I wasn't sure if it was user error on my part or if I should be looking into using core functionality instead?
I am using the compile method in my project to compile a piece of DOM in the leaflet map view.
you can check out the code here:
https://github.com/capaj/postuj-hovna/blob/d493d78e61094e4f7be274a9e336f72b64f720a8/www/components/map.js#L90
I would expect this to compile a DOM which has my map-popup-content behaviour and trigger that behaviour. Instead nothing happens, not even a console error. Am I doing something wrong?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.