Dec. 4th, 2013

andrewducker: (Default)
Although in this case I'm at home, having great fun, having taken a day off.

I'm still trying to make computers do things though - in this case I'm getting more stuff with AngularJS working. So far it's much, much better than doing things directly with JS/HTML - it feels like what HTML _should_ be if you're going to write proper applications in it - declarative statements about what data should be displayed where, and how to format it, which then get filled in automatically.

This, for instance, is a combobox/select, with the contents of a list in it:
<select ng-model="currentInput" ng-options="input.userName+'@'+input.siteName for input in data.inputs"></select>
so that I get a list of inputs, each formatted nicely, with the currently selected one stored in "currentInput". So much easier than the standard way of working with it.

Oh, and it supports transclusion, so I can split my HTML into small parts that are loaded on demand, rather than stuffing everything into one file. Magic!

Of course, I got completely stuck a few days ago, trying to work out why on earth my dialog boxes weren't working. Dialogs aren't part of the base Angular functionality - but they are part of the Angular UI collection, rebuilding Twitter Bootstrap in Angular-speak, so that you only need the Bootstrap CSS, not all of its JS and nomenclature. So I loaded in the code, started working through things, and hit a brick wall. A brick wall I just leaped happily over when I discovered that I was using Bootstrap CSS 3.0.2 and Angular Bootstrap only supports version 2.3. Switch over to the old version of the CSS and magically everything starts working...

It's these kinds of things that turn a half-day task into a three-day one. *sigh*

September 2025

S M T W T F S
  12 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 181920
21222324252627
282930    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 19th, 2025 06:16 am
Powered by Dreamwidth Studios