Last active
May 11, 2023 11:20
-
-
Save MaximBalaganskiy/511fc27fe6bc33ec97acf0607b2525a8 to your computer and use it in GitHub Desktop.
typed-plugin-bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Dumber Gist</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"> | |
<base href="/"> | |
</head> | |
<!-- | |
Dumber gist uses dumber bundler, the default bundle file | |
is /dist/entry-bundle.js. | |
The starting module is pointed to aurelia-bootstrapper | |
(data-main attribute on script) for Aurelia, | |
The aurelia bootstrapper then loads up user module "main" | |
(aurelia-app attribute on <body>) which is your src/main.ts. | |
--> | |
<body aurelia-app="main"> | |
<script src="/dist/entry-bundle.js" data-main="aurelia-bootstrapper"></script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"dependencies": { | |
"aurelia-bootstrapper": "latest", | |
"aurelia-typed-observable-plugin": "latest" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<require from="./my-attr"></require> | |
<require from="./my-elem"></require> | |
<!-- Try to create a css/scss/sass/less file then require it here --> | |
<h1 my-attr="text.bind: 'text'; textNone.bind: 'textNone'">Click me!</h1> | |
<my-elem text-none="textNone"></my-elem> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class App { | |
public message: string = 'Hello Aurelia!'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Aurelia} from 'aurelia-framework'; | |
import { coerceFunctions, createTypedBindable } from 'aurelia-typed-observable-plugin'; | |
coerceFunctions.none = function (a) { | |
return a; | |
} | |
createTypedBindable('none'); | |
export function configure(aurelia: Aurelia) { | |
aurelia.use | |
.standardConfiguration() | |
.developmentLogging('info'); | |
aurelia.start().then(() => aurelia.setRoot()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { bindable } from 'aurelia-typed-observable-plugin'; | |
import { customAttribute } from 'aurelia-templating'; | |
@customAttribute('my-attr') | |
export class MyAttr{ | |
constructor(private element: Element) { | |
} | |
@bindable.none | |
textNone: string; | |
@bindable | |
text: string; | |
attached(){ | |
this.element.addEventListener('click', () => alert(`Text: ${this.text}, TextNone: ${this.textNone}`)); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template>${textNone}</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { bindable } from 'aurelia-typed-observable-plugin'; | |
export class MyElem { | |
@bindable.none | |
textNone: string; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment