Tips:
- use $(function(){}); instead of $(document.ready(function({}));
- $(‘.div’).toggle() instead of show(), hide(), .sideToggle(), .fadeToggle(), .delay(). can use numbers for time in ms.
- .on(‘click’, function({})); bind the event to the element.
- DOM traverse method in jQuery, .parent(), .children(), .sibling(), .closet(), great method.
- AJAX is one of coolest things, use Mustache.js to template the html code for AJAX pending.
Tips:
- ng-app, ng-model, expression the same way as ng-bind, ng-init, set the init value.
- angular object is like JavaScript object. Angular array is like javascript array.
- ng-repeat, repead the html elements
- ng-disabled, use to disable the button or the input filed.
- ng-show, ng-hide to show or hide the element
- ng-click,set the click event to the element, check how many times of clicks.
BIG PROBLEM:
- In slim, if I change the name of the ng-app, it will understand as string value. But if I leave the name empty, it works fine.
- Set the ng-app name to enable the angular set, or you will get the problem: will be outputed as a string