Thursday, 23 March 2017

How to use routing feature in your application ?


AngularJS Route module is another JS file : angular-route.min.js
You can download and use JS file directly or use the CDN (Remote) link.

DOWNLOADED AND USE JS
  • You can download it from AngularJS 1x Home > Download > Browse additional modules
HTML
Assume you have all JS in a "scripts" directory in parallel

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
   <title>Hello</title>
   <script src="scripts/angular.min.js" />
   <script src="scripts/angular-route.min.js" />
</head>
<body>
   ......
</body>
</html>



USE CDN LINK
  • Go to AngularJS 1x Home > Download > Copy CDN link 
  • Edit the CDN URL to use angular-route.min.js instead of angular.min.js
    https://ajax.googleapis.com/ajax/libs/angularjs/1.6.3/angular-route.min.js
     
Use it directly in src attribute of script :

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.3/angular-route.min.js" />

No comments:

Post a Comment

Note: only a member of this blog may post a comment.