.state ('pages', { url: '/pages', templateUrl: 'views/common.html' })
<script type="text/ng-template" id="common.html">
how to use this using Ui-router?
It will be helpful to you
var myApp = angular.module('testApp', []);
myApp.run(['$templateCache',function($templateCache) {
$templateCache.put('common.html', ' <p>how to use this using Ui-router?</p>');
$templateCache.put('views/common.html', ' <p>how to use this using Ui-router?</p>');
}]);
myApp.config(['$stateProvide','$templateCache',function($stateProvider,$templateCache){
$stateProvider.state ('pages',
{ url: '/pages',
template: $templateCache.get('common.html')
})
.state ('pages',
{ url: '/pages',
templateUrl: 'views/common.html'
})
}]);
myApp.controller('testCtrl',function($scope){
})
<body ng-app="testApp" ng-controller="testCtrl">
</body>