AngularJS-如何链接到目录路由内的另一个HTML页面

时间:2019-03-26 12:05:10

标签: angularjs

我有一个通过PhoneGap运行的单页角度应用程序(angular.html)。我想从angular.html中的链接打开另一个HTML文件(index.html)。当我设置从我的angular.html文件到index.html的链接时,什么也没发生-链接不起作用。我的模板如下设置:

  <script type="text/ng-template" id="main.html">

          <a href = "index.html">Go to new html page</a>

          // more code

  </script>

  <script type="text/ng-template" id="about.html">

          // code

  </script>

我的路线如下:

              $routeProvider
                .when('/about/', {
                    templateUrl: 'about.html',
                    controller: 'dataController'
                })
                .otherwise({            
                    templateUrl:'main.html',
                    controller: 'dataController'

                });

我想念什么吗?为什么我不能链接到我的angular.html文件并打开一个新的html文件?谢谢...

0 个答案:

没有答案