【问题标题】:Can't get ng-view with routing to work无法通过路由工作获得 ng-view
【发布时间】:2013-07-18 00:02:09
【问题描述】:

我查看了许多具有类似主题的问题,但找不到适合我的代码的解决方案。我正在尝试通过其路由将我的 ng-view 标记链接到 html 片段,但我看不到我缺少什么。我已经简化了我的问题并将其放在this plunker. 谢谢!

【问题讨论】:

    标签: javascript web-applications angularjs routes


    【解决方案1】:

    您忘记引导 angularjs。最简单的方法是将 ng-app 放在 html 标签中:

    <html ng-app="GATapp">
    

    此外,您的部分视图(如welcome-msg.html)不需要包含html、head 和body 标签。这些标签已经存在于 index.html 中。

    这是最新的 plnkr:http://plnkr.co/edit/EDHyrw?p=preview

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-09-30
      • 2015-07-10
      • 1970-01-01
      • 2018-09-01
      • 2013-04-08
      • 1970-01-01
      • 1970-01-01
      • 2013-06-05
      相关资源
      最近更新 更多