Angular is a new JavaScript framework from Google. If you are looking into developing rich web applications, Angular is your friend. Angular embraces HTML and CSS, allowing you to extend HTML towards your application, and uses plain JavaScript which makes your code easy to reuse, and test. In this workshop we will start from the ground up, and build our way through a simple application that will let us explore the various constructs, and the familiarize ourselves with some of the new terminology in Angular.
In this workshop we will get down and dirty with Angular. In this workshop we will start with the very basics of how to boostrap our AngularJS application, and work slowly towards making REST-ful AJAX requests to a backend. List of topics include
ng-app
ng-init
and the evaluation {{ }}
directive$rootScope
ng-model
ng-repeat
ng-form
, form validation and submission in AngularJS$http
$routeProvider
and $routeParams
If time permits we will discuss a few good practices when working with AngularJS applications.
This is a hands on tutorial so bring your laptops!
This session is a workshop. Please come prepared.
brew install git
Make sure Git is available on your path
Open up a new terminal window
$ git --version
> # Anything greater than 2 will do
> git version 2.1.3
Make sure leiningen is available
$ lein --version
> Leiningen 2.5.1 on Java 1.8.0_40 Java HotSpot(TM) 64-Bit Server VM
If you have an account on Github, feel free to fork the repository and then clone it.
Clone the repository on Github
At a terminal, cd
into a directory and run git clone git@github.com:looselytyped/angudone-workshop.git
. Note that if you did fork the repository under your account your URL will be something like git@github.com:<YOUR-ACCOUNT-NAME>/angudone-workshop.git
Wake up the application
# at the terminal
# cd to where you cloned the repository above.
$ git checkout master-1.4
$ lein ring server
# This will download a whole bunch of files from Maven Central
# and will end with
# Started server on port 3000
http://localhost:3000/
(If it does not just go to that URL). You should see a HTML page announcing Angudone
Ensure that the REST
endpoints are active
Right-Click -> Inspect Element
(this will open the Inspector) and then go to the Console
tabRight-Click -> Inspect Element
(this will open the Chrome Inspector) and then go to the Console
tab (right most)Both Console
s give you the ability to run JavaScript code. Run the following
http.get("todos")
.success(function(data, status, headers, config) {
console.log("There are " + data.length + " todos");
}).error(function(data, status, headers, config) {
console.error("Oh Noes! Something went wrong" + data);
});
You should see a a valid response indicated by There are 0 todos
Raju is a software craftsman with almost 20 years of hands-on experience scoping, architecting, designing, implementing full stack applications.
He provides a 360 view of the development cycle, is proficient in a variety of programming languages and paradigms, experienced with software development methodologies, as well an expert in infrastructure and tooling.
He has long been in the pursuit of hermeticism across the development stack by championing immutability during development (with languages like Clojure), deployment (leveraging tools like Docker and Kubernetes), and provisioning and configuration via code (toolkits like Ansible, Terraform, Packer, everything-as-code).
Raju is a published author, internationally known public speaker and trainer.
Raju can be found on Twitter as @looselytyped.
In his spare time, you will find Raju reading, playing with technology, or spending time with his wonderful (and significantly better) other half.