nanocomponent-adapters icon indicating copy to clipboard operation
nanocomponent-adapters copied to clipboard

angular adapter

Open yoshuawuyts opened this issue 8 years ago • 12 comments

@bendrucker @lrlna I honestly don't know who else to ask lol, if you could help out writing an adapter I'd owe you one haha :sparkles:

yoshuawuyts avatar Jan 30 '17 21:01 yoshuawuyts

can totes help out with this one :sparkles:

lrlna avatar Jan 30 '17 21:01 lrlna

Oh actually, which angular? I can help you with pre-2.0 directive; haven't done 2.0 stuff.

On Mon, Jan 30, 2017, 21:03 Yoshua Wuyts [email protected] wrote:

@bendrucker https://github.com/bendrucker @lrlna https://github.com/lrlna I honestly don't know who else to ask lol, if you could help out writing an adapter I'd owe you one haha ✨

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/yoshuawuyts/nanocomponent-adapters/issues/3, or mute the thread https://github.com/notifications/unsubscribe-auth/AHu3CA3T9uZVVqGsSMaxYXRMd8f_QueNks5rXlAxgaJpZM4Lx6VK .

lrlna avatar Jan 30 '17 21:01 lrlna

Same, haven't touched v2

bendrucker avatar Jan 30 '17 21:01 bendrucker

Angular v1 stuff would be grand I think; if I'm not mistaken that seems to be the thing that's used most nowadays anyway / what people end up working with - so if we can make their lives easier would be grand :D

On Mon, Jan 30, 2017 at 1:38 PM Ben Drucker [email protected] wrote:

Same, haven't touched v2

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/yoshuawuyts/nanocomponent-adapters/issues/3#issuecomment-276199567, or mute the thread https://github.com/notifications/unsubscribe-auth/ACWlei4xSnVlUPgXrPE6k8UmLGkbbkkLks5rXlhugaJpZM4Lx6VK .

yoshuawuyts avatar Jan 30 '17 23:01 yoshuawuyts

Cool. Shouldn't be too hard. Any thoughts on unit testing this stuff?

bendrucker avatar Jan 30 '17 23:01 bendrucker

ohh, yeah unit tests would be neat - didn't write any so far, but I bet using tape-run we could come a long way; probably should also add some to nanocomponent haha

On Mon, Jan 30, 2017 at 3:22 PM Ben Drucker [email protected] wrote:

Cool. Shouldn't be too hard. Any thoughts on unit testing this stuff?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/yoshuawuyts/nanocomponent-adapters/issues/3#issuecomment-276224258, or mute the thread https://github.com/notifications/unsubscribe-auth/ACWlesHrdzkeRWh4foiZ-XNnnRA5hJFrks5rXnCYgaJpZM4Lx6VK .

yoshuawuyts avatar Jan 30 '17 23:01 yoshuawuyts

uhhhh i haven't componentized angular in so long, so I am not sure if this is the right approach atm. Something like this for the spec?

var nanoToAngular = require('nanocomponent-adapters/angular')

module.exports = angular
  .module('nano', [])
  .directive('nanocomponent', nanoToAngular)

and hook it up in your html:

<nanocomponent render></nanocomponent>
<nanocomponent onupdate></nanocomponent>

So then component vals get handled in html. That will mean that the directive itself will have to handle all the nanocomponent interaction too.

Alternatively handle it within the $scope instead of working inside html directly.

lrlna avatar Feb 03 '17 17:02 lrlna

That looks right to me!

bendrucker avatar Feb 03 '17 19:02 bendrucker

Hey @lrlna, @bendrucker, @yoshuawuyts, may I suggest the following naming convention: nanocomponent-adapters/angularjs for Angular 1.x nanocomponent-adapters/angular for Angular 2+

Recently there's been a lot of discussion around this topic and the Angular team is settling with "just Angular" for the newer versions of the framework and AngularJS for 1.x See "Naming guidelines" section

Also, I've been doing some Angular work so I'd be happy to port the AngularJS version.

alterx avatar Feb 12 '17 17:02 alterx

If that's the convention, it sounds v reasonable to me. Afaik nobody's offered to write the Angular (2.x+) version yet so help would def be welcome!

On Sun, Feb 12, 2017, 18:27 Carlos Vega [email protected] wrote:

Hey @lrlna https://github.com/lrlna, @bendrucker https://github.com/bendrucker, @yoshuawuyts https://github.com/yoshuawuyts, may I suggest the following naming convention: nanocomponent-adapters/angularjs for Angular 1.x nanocomponent-adapters/angular for Angular 2+

Recently there's been a lot of discussion around this topic and the Angular team is settling with "just Angular" for the newer versions of the framework and AngularJS for 1.x See "Naming guidelines" section http://angularjs.blogspot.com/2016/12/ok-let-me-explain-its-going-to-be.html

Also, I've been doing some Angular work so I'd be happy to port the AngularJS version.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/yoshuawuyts/nanocomponent-adapters/issues/3#issuecomment-279233693, or mute the thread https://github.com/notifications/unsubscribe-auth/ACWlev6milx4yaG-I4ZMYyTGMlhayGTFks5rb0EIgaJpZM4Lx6VK .

yoshuawuyts avatar Feb 13 '17 06:02 yoshuawuyts

fyi, PR #6 adds support for custom elements and, consequently, for Angular (2+)

alterx avatar Feb 14 '17 22:02 alterx

from angular 1.5 there's also the component method - it's just sugar on top of a directive but it would be cool if there were unit tests passing for both directive and component

davidmarkclements avatar Feb 23 '17 16:02 davidmarkclements