codeforamerica / fast_pass

Las Vegas Development Opportunity Finder
BSD 3-Clause "New" or "Revised" License
7 stars 4 forks source link

Max words directive is broken in latest Angular (1.2.5) #91

Closed louh closed 10 years ago

louh commented 10 years ago

@rclosner - I took a look at this today.

The scope.countdown variable is getting calculated correctly, but apparently, it's no longer automatically available to the template for display. It looks like you have to explicitly make it available on the scope, much like the words variable is. The fix I'm proposing is in the commit above. Does it make sense?

I'm wondering if it has something to do with the breaking changes from the 1.2.0 timely-delivery release?

lovehandle commented 10 years ago

Hmm... great find! I couldn't figure this out for the life of me. I haven't tested this, but I think you might be right. I'll look into this, and fix all relevant changes if it turns out to be the problem.

louh commented 10 years ago

I forgot to add the warning variable as well, which makes the text red if it goes below zero.

I also tried this thing which didn't really work, where I put warning and countdown as a property on words (and then I made the content of the textarea words.content or something) just to see if we could pass in just words as an object by itself with an arbitrary number of directive-scoped properties on it. It sort of works, but Angular won't treats words.content as undefined on load, so it's not ideal. I didn't commit this but I just wanted to mention it.

lovehandle commented 10 years ago

@louh I'm assuming you made 'words' an object, then?

louh commented 10 years ago

@rclosner I attempted to, but it didn't work. Today I revisited and found where I was missing it last time. 'words' is an object now and all the properties on it are attached to it. I'm issuing this as a pull request so you can see if you like this way better.

louh commented 10 years ago

This is fixed, so closing, but leaving the pull request above open in case we want to change how it's done.