AngularJS was not even mentioned on the project but I figured it was time to demonstrate a way to implement AngularJS since it is the most popular implementation wanted right now.
Here it is: JSPLAIN
This book can be used as a reference if you need a detailed explanation on how a certain method works.
Get it today and start learning. You don’t need to own a Kindle. You’ll be able to read it on anyone of your computers by downloading the free Kindle app.
Google has come up with a modern solution: AngularJS
AngularJS is a way to make your HTML more dynamic and it is easy to implement.
Take a look at my sample here:
Have fun testing it!
reference variables, value variables, stack vs heap?
is short, sweet and right to the point.
Here’s my link: http://bit.ly/1wz2rLq
Have a great weekend!!
Hi dear reader,
you’ll be pleased to know that I have converted the project into AngularJS.
AngularJS was not even mentioned in the book but I figured it was time to demonstrate a way of implementing AngularJS on the script and it is a cool implementation as you may see on the following link:
The conditional operator is a one liner if/else statement. Another name for it is ternary operator because it uses three operands:
expression1 ? expression2 : expression3;
If expression1 evaluates to boolean true, expression2 gets executed. Else, expression3 gets executed instead.
If you’re like me, you probably prefer to use if, else if, else statements, but the ternary operator can be very handy at times. One of the things we can’t do with our regular branching techniques is to include alternative outputs on a one console.log statement, but with the ternary operator we can:
var x = 10;
var y = 9;
console.log(x < y ? "hello!" : "goodbye!");
// it outputs "goodbye!"
console.log(x > y ? "hello!" : "goodbye!");
// it outputs "hello!"
var text = "the quick
the lazy dog";
var text = "the quick \
brown fox \
jumps over \
the lazy dog";
Notice how I included the space before the backslash and not after it. We only want to escape the line return. Now, when we call variable text it outputs the the correct sentence: “the quick brown fox jumps over the lazy dog“