ng-init , ng-include , $http , service , $anchorscroll
- It is used to initialize the expression in html itself, try to ignore using ng-init, it is always good to initialize value of variable in controller.
ng-include
- It is use to embedded an html page into another html page. This technique is usefull when you want to reuse a specific view in multiple pages.
$http service in AngularJS
- It is used to make http request to remote server.It has single input parameter that is configuration object.
Service in angularJS
- A service is simply an object that provide some sort of functionalityt that can be reused again within angular application.
$anchorscroll service in angularJS
- It is used to jump to specified element page.
- Inject service $location and $anchorscroll and pass id in controller.
- $location.hash(value);
- $anchorscroll()
- $location service will add hash fragments in url
- $anchorscroll methods reads the hash fragments in the url and jumps to that element on page.
No comments