วันพฤหัสบดีที่ 26 ธันวาคม พ.ศ. 2556

Resource : AngularJS

Directive

an easy-understandable and practical tutorial

Scroll to Anchor

http://stackoverflow.com/questions/17711232/scroll-to-in-angularjs

Useful Pages

AngularJS Newsletter : many useful articles
http://www.ng-newsletter.com/posts/
my favorite, short one
http://www.ng-newsletter.com/advent2013/#!/

AngularJS tips (haven't check yet but likely useful)
http://angular-tips.com/

Using AngularJS + underscore.js
http://blog.mohammedlakkadshaw.com/AngularJS_Underscore_ultimate_web_development.html#.UrutMJDtnb4

A Good Explanation to Directive in AngularJS
http://www.ng-newsletter.com/posts/directives.html

Using AngularJS + jQuery chosen
http://onehungrymind.com/angularjs-chosen-plugin-awesome/
NOTE: change $watch --> $watchCollection

Difference between href and path()

$window.location.href = ('/actual/add');wll go back to server to fetch page, e.g. http://localhost:8000/actual/add, while
$location.path('/add');will lookup $routeProvider with to fetch content to fill <ng-view> tag
browser URL will show e.g. http://localhost:8000/actual#/add

Multiple Apps in Same Page

sample here >> http://plnkr.co/edit/UowJpWYc1UDryLLlC3Be?p=preview
instead of ng-app directive, use following code
<script>
angular.element(document).ready(function() {
        angular.bootstrap(document.getElementById('myApp1'), ['myApp1']);
        angular.bootstrap(document.getElementById('myApp2'), ['myApp2']);
});
</script>

ไม่มีความคิดเห็น:

แสดงความคิดเห็น