javascript - 无法查看 ion-content

标签 javascript html angularjs ionic-framework

我无法在 Ionic 页面中获取内容和标题标题。让我知道我做错了什么。

预计会有一个带有左右按钮和一些内容的正栏标题,但它完全空白,控制台中也没有 JS 错误。

index.html

  <body ng-app="starter">
    <ion-nav-view></ion-nav-view>
  </body>

app.js -

  .state('signup', {
    url: '/signup',    
    views: {
      'signup': {
        templateUrl: 'templates/signup.html'
      }
    }
  })

signup.html -

<ion-header-bar align-title="left" class="bar-positive">
  <div class="buttons">
    <button class="button">Left Button</button>
  </div>
  <h1 class="title">Title!</h1>
  <div class="buttons">
    <button class="button">Right Button</button>
  </div>
</ion-header-bar>
<ion-content>
  Some content! Some content! Some content! Some content! Some content! Some content! Some content! Some content! 
</ion-content>

最佳答案

您的状态配置 signup查找名为 signup 的命名 View (在 views 对象下)但是你的 <ion-nav-view>不是一个有名字的人。您可以通过添加 name 来解决此问题属性为<ion-nav-view>像下面这样。

<ion-nav-view name="signup"></ion-nav-view>

(或者)如果您确定始终有一个 View 需要更新,则可以从您的状态中删除命名 View 定义。

.state('signup', {
    url: '/signup',    
    templateUrl: 'templates/signup.html'
  });

关于javascript - 无法查看 ion-content ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34751302/

相关文章:

html - 使用 google API 将 google+ 登录按钮实现到本地主机

java - spring boot无法解析html View

javascript - angularjs 处理 $resource $promise 错误

javascript - 如何在 Django 模板过滤器中使用 Sekizai javascript block ?

javascript - 根据搜索词的相关性对多个 JavaScript 数组进行合并和排序

javascript - 使用浏览器调整大小调整、移动和缩放图像和文本 div

html - 缩放时 DIV 定位问题

javascript - 文本框长整数值在 angularjs 中显示为指数类型

javascript - 使用 Javascript 缩放网页的所有内容

javascript 滚动 div