Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Conversation

@tomplusplus
Copy link
Contributor

@kevmoo @kwalrath. Please review. This one was big, with a lot of the logic in the html template. I recreated the TS plunkr example, but there were quite a few things that didn't work quite the same. We can chat more about when Kathy is ready to write up the tutorial.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this from? Where is this used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a great question! It's in the plunkr example at the bottom, but scanning through the the actual docs I don't see a reference to it anywhere.
@kevmoo ,@kwalrath do we want to scrub it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see _Color.Red used below. Is that what @kevmoo was referring to?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kwalrath .Yep, at the very bottom of index.html in the TS example app there is a blurb about using enums in bindings. That's the part that references this enum and the colorToggle() method. What I meant to say was I don't see any reference to it in the actual tutorial. So I'm not sure if it was just scrubbed, or if it will be referenced at a later time.
On this note, I had a heck of a time trying to figure out how to use enums in Dart in the way that the TS example is using it. I'm not sure that what I ended up with is even right. Let me know if there is a better way to tell the same story here. Thanks.

@kevmoo
Copy link

kevmoo commented Nov 19, 2015

@tomplusplus work through those fire set of items...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, this is where _Color is used!

@kwalrath
Copy link
Contributor

kwalrath commented Dec 2, 2015

I'm going to start on the tutorial now, fwiw...

@tomplusplus
Copy link
Contributor Author

=> '$firstName $lastName' aaahhh, so that's how you do string interpolation (wink). I like that better as well. Done!

@kwalrath Let's chat tomorrow before you start the tutorial. The code I did here is actually the example for the new User Input example. It was a bit confusing since the Template syntax is almost identical.

@kwalrath
Copy link
Contributor

kwalrath commented Dec 3, 2015

About my template syntax work: I've only been working on the text, not the code yet, so it's not too late to switch to something else.

About the enums: @kevmoo what do you think we should do? I've never used enums in Dart, except to demonstrate very basic usage.

Tom, let's chat on Slack later... I'll be offline for about an hour, but when I get back we can talk.

@tomplusplus tomplusplus force-pushed the DeveloperGuides/template-syntax branch from a168174 to eae8973 Compare December 11, 2015 22:11
@tomplusplus
Copy link
Contributor Author

@kwalrath @kevmoo . Just updated this one to match the current TS example after Ward split out this form User Input. There were quite a bit of changes so it probably warrants another look through.
There is an issue with the ngClass and ngStyle binding sections. That I could not figure out to save my life. I'm going to try and get with Kathy tomorrow ( if she is available) to see if we can figure it out. Here is a screen shot of the error message http://cl.ly/2i2t3h1k0I3g. Those sections are commented out for the time being.

Thanks

Tom

@tomplusplus
Copy link
Contributor Author

OK found a fix with @kwalrath for the above mentioned error. May still warrant some discussion if the fix is the right way to go.

@kwalrath
Copy link
Contributor

kwalrath commented Jan 5, 2016

@kevmoo Do you have an opinion on the fix? I'm inclined to take this code as-is, so I can get started on the text.

@kwalrath kwalrath changed the title [WIP]Initial commit of the dart Template Syntax example. docs(guide): add Dart Template Syntax example Jan 5, 2016
@kevmoo
Copy link

kevmoo commented Jan 8, 2016

@tomplusplus please run dartfmt one more time – app_component needs some cleanup

@kwalrath, @tomplusplus What "fix" are we talking about?

@kwalrath
Copy link
Contributor

kwalrath commented Jan 8, 2016

The fix was to reuse maps (styles & classes) rather than returning a new object each time. This is different from the TS code, and it took a while to figure out what to do.

@wardbell
Copy link
Contributor

wardbell commented Jan 8, 2016

Aaaargh!

The problem Tom encountered is caused by DevMode and is NOT a problem with A2 itself nor should we be changing anything in our recommendations.

A fast fix would have been to switch to ProdMode.

DevMode will be reworked very soon so we don't get these false errors. I was going to go back and fix the TS version in the meanwhile so that it doesn't blow up (yes, it blows up for me too). I just hadn't gotten to it. Maybe that is the fix that you're talking about here re: maps. If so, I'll steal it.

@kwalrath
Copy link
Contributor

kwalrath commented Jan 8, 2016

I guess we should cover these modes in the docs. It's slightly complicated by the fact that Dart has its own modes (checked vs production).

However, it looks like prod mode doesn't work for Dart: angular/angular#5982, angular/angular#6189

@wardbell
Copy link
Contributor

wardbell commented Jan 8, 2016

Oh boy. We certainly do need to document those modes. We can take that up in a different issue/task.

Returning to this PR: were the necessary sample changes "behind the scenes" or did they affect what we're telling our audience?

Meanwhile, I can see that this PR only touches DART files. I will handle the TS sample code adjustments separately. Other than my question, I don't think I have anything to add here.

@kwalrath
Copy link
Contributor

kwalrath commented Jan 8, 2016

I haven't started the Template Syntax docs yet, so I don't know whether these changes will be visible. I suspect they will be, though.

@tomplusplus
Copy link
Contributor Author

Just getting back into this now. IMHO the current sample changes to make this work doesn't seem to effect anything we are telling the audience about Template Syntax or its use cases. But he code sample itself is different enough that I would suspect it may raise some questions. @wardbell Ill look today at the stuff you just recently committed for this sample :)

…ng interpolation where it make sense. Fix `Library` syntax for `little_hero`. Add #docregion comment to all relevant files. Move const List to inline List in class declaration and set `currentHero` in constructor. Create constructor for `AppComponent` class.
…bute to pubspec.yaml and remove `CORE_DIRECTIVE` injection
@tomplusplus tomplusplus force-pushed the DeveloperGuides/template-syntax branch from ed2acfb to d759f7f Compare January 14, 2016 04:38
@kwalrath
Copy link
Contributor

Did you get a chance to look at Ward's changes?

I think app-component.html should be app_component.html, but otherwise I'm inclined to take this as-is. We can always iterate...

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this mean? I got the impression this is the preferred style currently?

@kwalrath
Copy link
Contributor

I'm taking a look at this sample right now...

@kwalrath kwalrath closed this in 14de422 Jan 25, 2016
@kwalrath
Copy link
Contributor

I fixed a few issues and committed this. It still needs work, though.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants