Lunch and Learn @ Union Pacific
These slides are up on GitHub!
mrkelly/up-angularShare our experience building a production application using Angular JS
Many of the topics covered are universal to any JS dev
We love questions, don't be shy..you cannot derail us (challenge)
We are NOT experts, just write a ton of code.
// A task that runs in the background 'watching' for changes to code.
watch : {
options : {
livereload: true
},
client: {
files: [
'client/src/**/*.js',
'client/test/**/*.js',
'<%= assetsDir %>/templates/**/*.html'
],
tasks: ['assemble', 'karma:unit:run', 'karma:e2e:run']
},
server : {
files: [
'test/**/*.js',
'app/**/*.js'
],
tasks: ['mochacli']
},
views : {
files: [
'app/views/**/*.jade',
'<%= assetsDir %>/less/**/*.less'
],
tasks: ['assemble']
}
}
Uglification is the optimization/compression/minimization of source code. For JavaScript, we use UglifyJS2
Minification results on a real project
Because of mangling, Angular dependency injection and "Pretotyping" no longer works and leads to the infamous:
Uncaught Error: Unknown provider: aProvider <- a
Templates are static, so why not provide them as a compiled resource? This is where grunt-angular-templates comes in.
Arguably the best date formatting library on the planet
A long list of libraries for providing standard HTML4 and HTML5 capabilities in "web browsers" (IE)
respond.js is a CSS3 polyfill for media queries.
"A utility library delivering consistency, customization, performance, and extras."
One of the best base stylesheets and a great place to start with new applications
expect(foo).to.be.a('string');
expect(foo).to.equal('bar');
expect(foo).to.have.length(3);
expect(tea).to.have.property('flavors').with.length(3);
Check out this awesome talk by Rebecca Murphey at JSConf 2013
Spectacular test runner from the Angular JS team
More than likely your CI will be running on a headless OS. How do you run end-to-end tests with no display?
Phantom JS is a headless WebKit browser
X Virtual Frame Buffer provides a virtual X11 server on a headless device for GUI applications.