在离子离子视图中缺少标题

时间:2015-07-05 08:24:59

标签: javascript html css angularjs ionic-framework

出于某种原因,我无法显示Ionic标题:http://codepen.io/hawkphil/pen/oXqgrZ?editors=101

此代码并非完全100%遵循离子示例,但我不想添加2层状态(AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; NSDictionary *parameters = @{@"UserName": @"testman1@foodmandu.com", @"Password": @"testUserPw", @"grant_type": @"password"}; [manager POST:@"http://apifm.azurewebsites.net/token" parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) { NSLog(@"JSON: %@", responseObject); } failure:^(AFHTTPRequestOperation *operation, NSError *error) { NSLog(@"Error: %@", error); }]; /)只是为了做一个简单的页面,包括顶部和底部

HTML

/somethingelse

JS

  <ion-nav-bar class="bar-balanced">
    <ion-nav-back-button>
    </ion-nav-back-button>

    <ion-nav-buttons side="right">
      <button class="button button-clear">
        OK
      </button>
    </ion-nav-buttons>
  </ion-nav-bar>

  <ion-view view-title="{{ title }}">
    <ion-content class=" has-header">
      test test
      </<ion-content>
  </ion-view>

有没有办法解决这个问题?我需要一种用HTML显示动态标题的方法。

2 个答案:

答案 0 :(得分:2)

<ion-view> <ion-nav-view>应该在ui-router内,Sub header() Rows("1:1").Select Selection.Copy Dim Col As Variant Dim BlankRows As Long Dim LastRow As Long Dim R As Long Dim StartRow As Long Col = "P" StartRow = 1 BlankRows = 1 LastRow = Cells(Rows.Count, Col).End(xlUp).Row Application.ScreenUpdating = False With ActiveSheet For R = LastRow To StartRow + 1 Step -1 If .Cells(R, Col) = "Total" Then .Cells(R+1, Col).EntireRow.Insert Shift:=xlDown End If Next R End With Application.ScreenUpdating = True End Sub $ip_address=$_SERVER['REMOTE_ADDR']; if(!isset($_COOKIE['isp'])){ $ispinfo=@file_get_contents("http://ipinfo.io/".$ip_address."/org"); if($ispinfo==FALSE){ echo '<script src="//code.jquery.com/jquery-1.11.3.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.js"></script> <script> $.get( "http://ipinfo.io/'.$ip_address.'/org", function( data ) { $.cookie("isp", data, { path: "/", expires: 7 }); $isp_name="jQ"; }); </script>'; } else { $isp_code_string = explode(" ",$ispinfo); $isp_code=$isp_code_string[0]; $isp_name=str_replace($isp_code, '', $ispinfo); setcookie("isp", $isp_name, time()+10*365*24*60*60, "/"); } } else { $isp_code_string = explode(" ",$_COOKIE["isp"]); $isp_code=$isp_code_string[0]; $isp_name=str_replace($isp_code, '', $ispinfo); $isp_name="**".$isp_name; } #slideTest的一部分。您必须为要更新的动态标头设置一些基本路由。

我已经自定义了您的codepen docs

答案 1 :(得分:1)

由于您希望直接显示视图,而不是ui-router的路由,因此它应该是ion-nav-view而不是ion-nav&amp;然后更改nav标题ion-header-bar,&amp;然后,为了在离子标题上绑定HTML,你可以使用@shushanthp建议的答案。

<强>代码

<ion-nav-view view-title="{{ title }}">
  <ion-header-bar align-title="left" class="bar-balanced bar">
    <span ng-bind-html="title"></span>
  </ion-header-bar>
  <ion-content class=" has-header">
    test test
  </<ion-content>
</ion-nav-view>

Forked Codepen