demo.html
<!DOCTYPE html>
<html ng-app="app">
<head>
<title>AngularJs</title>
<script type="text/javascript" src="angular-1.5.5/angular.js"></script>
<script type="text/javascript" src="angular-1.5.5/angular-route.js"></script>
<script type="text/javascript" src="base.js"></script>
<style type="text/css">*{font-size: 14px; font-family: arial;}.orange{background-color: red;color:white;}</style>
</head>
<body>
<div ng-controller="Main">
<ng-view></ng-view>
</div>
</body>
</html>
----------------
base.js
var app = angular.module('app',['ngRoute']);
app.controller('Main',function($scope){
$scope.some= 'Hi is new world'
})
app.config(function($routeProvider){
$routeProvider.when('/',{
templateUrl:'blog.html'
})
})
-------------------------
blog.html
{{some}}
------------------------
Demo
Very good example of basic routing for beginners... good work ram pukar...
ReplyDelete