Fixed #465 - HTML in header titles

This commit is contained in:
Max Lynch
2014-01-23 13:02:44 -06:00
parent 766f97d94b
commit 85b709e5ac
5 changed files with 11 additions and 11 deletions

View File

@@ -2547,9 +2547,9 @@ angular.module('ionic.ui.viewState', ['ionic.service.view', 'ionic.service.gestu
// Clone the old title and add a new one so we can show two animating in and out
// add ng-leave and ng-enter during creation to prevent flickering when they are swapped during animation
title = angular.element(titles[0]);
oTitle = $compile('<h1 class="title" ng-bind="oldTitle"></h1>')($scope);
oTitle = $compile('<h1 class="title" ng-bind-html="oldTitle"></h1>')($scope);
title.replaceWith(oTitle);
nTitle = $compile('<h1 class="title" ng-bind="currentTitle"></h1>')($scope);
nTitle = $compile('<h1 class="title" ng-bind-html="currentTitle"></h1>')($scope);
var insert = $element[0].firstElementChild || null;
@@ -2578,7 +2578,7 @@ angular.module('ionic.ui.viewState', ['ionic.service.view', 'ionic.service.gestu
'<button view-back class="button" ng-if="enableBackButton" ng-class="backButtonClass" ng-bind-html="backButtonLabel"></button>' +
'<button ng-click="button.tap($event)" ng-repeat="button in leftButtons" class="button no-animation {{button.type}}" ng-bind-html="button.content"></button>' +
'</div>' +
'<h1 class="title" ng-bind="currentTitle"></h1>' +
'<h1 class="title" ng-bind-html="currentTitle"></h1>' +
'<div class="buttons" ng-if="rightButtons.length"> ' +
'<button ng-click="button.tap($event)" ng-repeat="button in rightButtons" class="button no-animation {{button.type}}" ng-bind-html="button.content"></button>' +
'</div>' +

View File

File diff suppressed because one or more lines are too long

View File

@@ -41,9 +41,9 @@ angular.module('ionic.ui.viewState', ['ionic.service.view', 'ionic.service.gestu
// Clone the old title and add a new one so we can show two animating in and out
// add ng-leave and ng-enter during creation to prevent flickering when they are swapped during animation
title = angular.element(titles[0]);
oTitle = $compile('<h1 class="title" ng-bind="oldTitle"></h1>')($scope);
oTitle = $compile('<h1 class="title" ng-bind-html="oldTitle"></h1>')($scope);
title.replaceWith(oTitle);
nTitle = $compile('<h1 class="title" ng-bind="currentTitle"></h1>')($scope);
nTitle = $compile('<h1 class="title" ng-bind-html="currentTitle"></h1>')($scope);
var insert = $element[0].firstElementChild || null;
@@ -72,7 +72,7 @@ angular.module('ionic.ui.viewState', ['ionic.service.view', 'ionic.service.gestu
'<button view-back class="button" ng-if="enableBackButton" ng-class="backButtonClass" ng-bind-html="backButtonLabel"></button>' +
'<button ng-click="button.tap($event)" ng-repeat="button in leftButtons" class="button no-animation {{button.type}}" ng-bind-html="button.content"></button>' +
'</div>' +
'<h1 class="title" ng-bind="currentTitle"></h1>' +
'<h1 class="title" ng-bind-html="currentTitle"></h1>' +
'<div class="buttons" ng-if="rightButtons.length"> ' +
'<button ng-click="button.tap($event)" ng-repeat="button in rightButtons" class="button no-animation {{button.type}}" ng-bind-html="button.content"></button>' +
'</div>' +

View File

@@ -21,7 +21,7 @@
left-buttons="leftButtons"
right-buttons="rightButtons"
type="bar-primary"></header-bar>
<header-bar type="bar-positive" title="'Location'" left-buttons="leftButtons" right-buttons="rightButtons"></header-bar>
<header-bar type="bar-positive" title="headerTitle" left-buttons="leftButtons" right-buttons="rightButtons"></header-bar>
<content>
<input type="text" ng-model="headerTitle">
@@ -30,10 +30,10 @@
angular.module('headerTest', ['ionic'])
.controller('TestCtrl', function($scope) {
$scope.headerTitle = 'A really really really really really long title here';
$scope.headerTitle = 'A really really <u>really</u> really really long title here';
$scope.leftButtons = [
{
content: 'Hello',
content: 'Hello <b>Hello</b>',
tap: function(e) {
console.log('Click button');
}

View File

@@ -27,7 +27,7 @@
</div>
<script id="sign-in.html" type="text/ng-template">
<view title="'Sign-In'" left-buttons="leftButtons" right-buttons="rightButtons">
<view title="'<u>Sign-In</u>'" left-buttons="leftButtons" right-buttons="rightButtons">
<content has-header="true">
<div class="list">
<label class="item item-input">