Viewing posts by mhughes

Filtering lists in your angular dart templates - take 2

Posted by: mhughes 1 year, 3 months ago

A few posts ago, I wrote about how to use the |filter method to filter an ng-repeat list. Unfortunately, that has one major problem. If an element of the list changes so the filter would no longer include it, the display is not updated.

Therefore, I'm not using that method anymore.

Now, in my custom components, I create a new list of filtered items and manually keep it updated, and then ng-repeat on that instead of the original source list.

read more /

AngularDart 0.11 released

Posted by: mhughes 1 year, 3 months ago

It's out, and contains that oh-so-delicious useShadowDom property I mentioned in my last post.

read more /

Angular.Dart ShadowDom / applyAuthorStyles / upcoming changes

Posted by: mhughes 1 year, 4 months ago

I was floundering for a while on the Angular.dart side of things when it came to how to structure the pieces of my application.

I started off using NgComponents, and all was good. Until I tried applying CSS styles across component boundaries, and things just started falling apart due to the components using the ShadowDom. A bit of searching, and I found the applyAuthorStyles attribute, and all was good with the world again.

Some time later, I read that applyAuthorStyles is going away because it's been removed from the shadowDom spec. That breaks my solution. So I transitioned to using an NgController with an NgInclude to approximate a component, but have it actually be on the DOM. Once again, everything seemed good.

... Until I read that NgController is being deprecated and you have to use components (which will now be called Component instead of NgComponent). There goes my workaround. I was a bit worried about how I'd get everything working the way I wanted.

And finally, I saw this commit, which adds a useShadowDom property to components, letting you create the components right on the main document dom.

So I've gone full circle and am back to using @Component

I guess this is the sort of thing to expect when using a pre 1.0 framework on a relatively new language.

read more /

Filtering lists in your angular dart templates.

Posted by: mhughes 1 year, 4 months ago

Update: See this blog post for some important notes and a different way of doing it.

Last week I started a new project utilizing angular.dart, and it's been a great learning experience so far. Today, I wanted to try and figure out how to make an interface that looks something like this:

alt text

I have a single list of cards with a property on the card that determines which column it goes in.

I could have split up the list into 3 lists in my controller, but then I'd have to worry about keeping those column specific lists in sync with the master list. This is a multi-user realtime app, so that would have gotten troublesome quickly.

After a lot of wrangling, I figured out you can use the "filter" filter on a list to trim it down to the entries you care about. By using this three times, I was able to write a bit of template code to make it all work.

The filtering magic is in the "state in | filter:{column:'backlog'}" piece.

You can also see that I'm using ng-include for the body of the cards, so I don't have to repeat that for each column. And lastly, the behavior of the card itself is managed by a controller that binds to the kanban-cell attribute and is looking for a card-id attribute to tell it which card to display.

read more /

Quick update on uwsgi/nginx migration

Posted by: mhughes 1 year, 5 months ago

It's been 3 weeks since we switched from Apache/mod_wsgi to uwsgi/nginx and we have no regrets.

The trend of faster response times compared to the previous time frame has continued. And our mystery problem has completely gone away. Everything has been rock-solid.

read more /