Getting started is a bigger chore than I thought it’d be.

Holy cow, the last 3+ hours have just been trying to get testing working under Angular. I kept hitting something where calling ‘require()’ would kill the test. I looked at tons of examples and everyone was handling the setup differently. Then I noticed that some package.json files were including ‘@angular/core’:2.0.0-rc.1 and some used ‘angular2’:2.0.0-beta.13. I played around with version and going from beta.15 to beta.16 would break the project and ‘angular2’ didn’t even have an rc version. I should have better prepared myself for this prerelease framework mayhem.

I tried grabbing projects from github and the npm install would fail or some other problems would pop up. I finally found the Angular QuickStart project which from the Angular team. I was skeptical that it would work as so much of the documentation and non-core resources are in disarray, but I downloaded it and was able to run trough the build and test phases which is better than any other project that included tests.

The read me states that while it is a starting point, it is not designed for production. I hope to learn where it isn’t suitable for production, but as of now it is certainly the best jumping off point for me. For the next development sessions and posts, I’m going to explore the layout of the QuickStart project and play with the tests to make sure I have a reasonable understanding of what is going on so I have a better chance fixing things when they inevitably break.

I spent an hour+ trying to get a Jasmine test for an Angular 2 component. I didn’t have a problem writing a generic Jasmine test, but when I tried to import an Angular component the Jasmine test would stop running. I think there’s something going on with the configuration. I’m going to try to find another tutorial. The book and post I’ve been using don’t have a complete setup. I really prefer to have a working example and figure out what the configuration values mean, but I might have to figure out the configuration so I can get things running. This case of learning involves a lot of failing.

Made another small but important step in the project. I created the package.json file and added dependencies for angular2 for Angular 2 development and jasmine-core, live-server, and concurrently for Jasmine testing. I also created a tsconfig.json and cribbed most of its contents from an example to get TypeScript compiling in the project. As part of the Jasmine installation the typings.json file was created which contains additional Jasmine information.

Lastly, I created app.ts for my app component and app.spec.ts for the app component tests. Both of these files were empty, but they are getting compiled when I run the ‘tsc’ command. I think I’m on the verge of writing my first test.

I made my first commit to Crimson Comet, the code name for this flash card web service. It was quite simple with just a .gitignore file and an NPM package.json file. I’m not sure how much more I’ll get done today since it is Saturday and we have a bunch of activities to attend to but this is the kind of progress I’m looking for. Even on a light day I do something to move Crimson Comet forward.

A couple months back I started a simple iOS project that would display flash cards for Luther’s Small Catechism. It seemed like a good opportunity to really focus on learning Swift and do a project that would be edifying for the church. What bothered me was that the app would be iOS only. The Triglotta app is iOS only and I do get requests for an Android version but I don’t have any interest in working in Java for a side project since I get plenty of exposure to it at work. At the same time I’ve been studying Node.js and the frameworks built on top of it like Angular 2 and Ember.js. This got me thinking about building a flash card web service. I could then build a web front end using a JavaScript framework and I could also build an iOS native app as well. I could also expose the API someone else could build an Android native client if they wanted to.

Once again I’m starting off in a new direction. My current thinking is to build the web service using Node.js and Ember.js with a MySQL database. I would use Angular 2 to develop the web front end and eventually build an iOS native client in Swift. I’m going to commit to using BDD to develop the whole thing. I’m going to work on it every day in some way, and I’m going to blog about it in some way every day. Vacations might be an exception, but I’m going make every effort to make some progress and blog about it even then.