@@ -4,31 +4,33 @@ Hello everyone. Hope you're all doing great.
4
4
We at [ Conta Systemer AS] have chosen a path to migrate our existing code base from AngularJS to Elm.
5
5
It's obvious that AngularJS is dying. It's nice that we have a great opportunity to use such language as Elm.
6
6
7
- We have quite big application written in AngularJS (more than 100k LoC).
7
+ We have a quite big application written in AngularJS (more than 100k LoC).
8
8
And It would be quite stupid and very time consuming to rewrite everything on Elm.
9
- So we thought hard how to achieve best collaboration between AngularJS and Elm.
10
- Which will give us possibility to reuse code both ways.
9
+ So we thought hard how to achieve the best collaboration between AngularJS and Elm.
10
+ Which will give us the possibility to reuse code both ways.
11
11
12
- The part when we want to add new functionality written on Elm to AngularJS app is straight forward . And it works really well.
13
- * Create new directive/component
12
+ The part when we want to add new functionality written on Elm to AngularJS app is straightforward . And it works really well.
13
+ * Create a new directive/component
14
14
* Embed Elm program
15
15
* Use ports for communication
16
16
17
17
But we also want to reuse heavy directives/components written on AngularJS in Elm.
18
- The best way to do it would be to wrap AngularJS component/directive with custom element.
18
+ The best way to do it would be to wrap AngularJS component/directive with a custom element.
19
19
So we can use ` Html.node "custom-element-name" ... ` to let browser render it and compile AngularJS component/directive.
20
20
Custom elements are really great.
21
21
They allow us to create AngularJS scope on the fly and compile directive/component with all required stuff for it.
22
22
23
- This gist will show you how to automate wrapping of AngularJS component/directive with custom element.
23
+ In this repo you can find an AngularJS service which will automate wrapping of a component/directive with a custom element.
24
24
It works well for us so far.
25
25
26
26
At [ Conta Systemer AS] we use ES5 syntax for custom elements so that we don't have to transpile ES6 syntax.
27
- You can find more information about it in [ this gist] ( https:// gist.github.com/akoppela/8a19d9b039e9af21c4b27b5c4c998782 ) .
27
+ You can find more information about it in [ this gist] [ custom-elements- gist] .
28
28
29
- You can see the usage example [ here] ( https://ellie-app.com/3Dr29ZgH6KHa1 )
29
+ You can see the usage example [ here] [ example ] .
30
30
31
- [ Conta Systemer AS ] : https://github.com/ContaSystemer/
31
+ [ Conta Systemer AS ] : https://github.com/ContaSystemer
32
+ [ custom-elements-gist ] : https://gist.github.com/akoppela/8a19d9b039e9af21c4b27b5c4c998782
33
+ [ example ] : https://ellie-app.com/3Dr29ZgH6KHa1
32
34
33
35
---
34
36
0 commit comments