Angular.js : Comment utiliser ng-href modèle?

J'essaie de créer un simple SPA avec 1 index.html qui incluent des modèles.

J'ai eu un problème avec ng-href directive:

 <a ng-href="#/myPage">myPage</a>

travail dans index.html mais pas dans mes modèles, le lien est unclickable. mais href fonctionne toujours.

<a href="#/myPage">myPage</a>

Mon application :

index.html:

...
<body ng-app="myApp">
    <a ng-href="#/myPage" target="_self">link</a> <!-- work ! -->
    <div class="container" ng-view=""></div>
</body>
...

app.js:

'use strict';

angular.module('myApp',
        [ 'ngCookies', 'ngResource', 'ngSanitize', 'ngRoute' ]).config(
        function($routeProvider) {
            $routeProvider.when('/', {
                templateUrl : 'views/main.tpl.html',
                controller : 'MainCtrl'
            })

            .when('/myPage', {
                templateUrl : 'views/page.tpl.html',
                controller : 'MainCtrl'
            })

            .otherwise({
                redirectTo : '/'
            });
        });

controller.js

'use strict';

    myApp.controller('MainCtrl', function() {
        this.myColor = 'blue';
    });

page.tpl.html

<div>
    <a ng-href="#/myPage" target="_self">link</a> <!-- Dont work -->
    <a ng-href="#/myPage" target="_self">link</a> <!-- Dont work -->
    <a ng-href="#/myPage{{}}">link</a> <!-- Dont work -->
    <a ng-href="#/{{ 'myPage' }}">link</a> <!-- Dont work -->
    <a href="#/myPage" target="_self">link</a> <!-- Work ! -->
</div>

Je ne comprends pas le problème avec ng-href et pourquoi le résultat est différent de href.
J'utilise angulaire 1.2

InformationsquelleAutor Thomas | 2014-05-22