Angular: Empty Fiddle

http://angularjs.org/

by pkozlowski_opensource

HTML

<script type="text/ng-template" id="embeded.tpl.html">
    embeded template: {{subParams}}
</script>

<div ng-controller="MyCtrl">
    {{routeParams}}
    <hr>
    <ul>
        <li><a href="#/link/foo">foo</a></li>
        <li><a href="#/link/bar">bar</a></li>
    </ul>
    
    <div ng-view></div>
</div>

JavaScript

var myApp = angular.module('myApp', []);
myApp.config(function($routeProvider) {
       
    $routeProvider.when('/link/:test', {
        controller: 'SubCtrl',
        templateUrl: 'embeded.tpl.html'
    });
});

myApp.controller('MyCtrl', function($scope, $routeParams) {
    $scope.routeParams = $routeParams;
});

myApp.controller('SubCtrl', function($scope, $routeParams) {
    $scope.subParams = $routeParams;
});