HTML entities get encoded twice with dynamic binding - html

how do id encode/decode html in ionic framework
below is my code.
<ion-view view-title="Products">
<ion-content class="padding">
<div class="list">
<div class="card" ng-repeat="item in products">
<a class="item item-avatar" on-tap="productDetails(item.ProductId)">
<h2>{{item.Name}}</h2>
<p>Price {{item.Prices[0].Value}}</p>
<p>{{item.Description}}</p>
</a>
<a class="item item-image" on-tap="productDetails(item.ProductId)">
<img ng-src="{{item.ImageUrl}}"/>
</a>
<!--<div class="item item-icon-left energized" >-->
<div class="button-bar">
<div class="button button-clear energized" ng-click='addToCart(item.ProductId);' style="font-size:80%;">
<i class="icon ion-ios-cart"></i>
Add To cart
</div>
<div class="button button-clear energized" on-tap="productDetails(item.ProductId)" style="font-size:80%;">
<i class="icon ion-eye"></i>
View More
</div>
</div>
<!--</div> -->
</div>
</div>
</ion-content>
when I tried to fatch my record from product and
it is encoding
therefore browser is showing like the below image
And the value store in salesforce product2 object is
"Pacifique - Bora Bora Pearl Beach Resort & Spa - Polynésie française"

Use
<h2 ng-bind-html-unsafe="item.Name"></h2>
The documentation can be found here
There is a working plunkr -> http://plnkr.co/edit/dOzvvNcaLjd9CsKzyIY0?p=preview

Related

Change hovered dropdown content-Bulma

I am using Bulma and I made an hoverable dropdown, but the dropdown content exceeds the whole page content. How can I make it fixed with larger width and also responsive?
For now it looks like this:
Html code:
<div class="navbar-end">
<div class="dropdown is-hoverable navbar-item ">
<div class="dropdown-trigger">
<button aria-controls="dropdown-menu6" aria-haspopup="true" class="button is-primary">
<strong>Account</strong>
</button>
</div>
<div class="dropdown-menu has-text-centered" id="dropdown-menu6" role="menu">
<div class="dropdown-content">
<div class="dropdown-item">
<p>Acces your quizbee account, test your skills and have fun. </p>
<hr class="dropdown-divider">
<div class="buttons is-centered">
<button class="button is-primary is-rounded">Register</button>
<button class="button is-light is-rounded">Login</button>
</div>
</div>
</div>
</div>
</div>
You just need to set a position of dropdown. Add class is-right
<div class="dropdown is-right is-active">

I'd like to add a language button to my header. How can I insert it?

With a lot of trial and error I finally created a language button for my Squarespace website in the style of the website.
The website in question: https://www.happylifeclinic.org and the button is currently in a markdown block just under the header image. I'd like to have it just right of the 'Contact" button and I can't, for the life of me, figure it out how and where to input the HTML code (I'm using GitHub Desktop and editing the HTML with Sublime 3).
If I left something out please let me know.
You need to shift the whole block of code sqs-block to the header section in HTML. I tried doing following from inspector and it works fine :
<nav id="mainNavigation" data-content-field="navigation-mainNav">
<div class="collection active homepage">
<a href="/">
Acasa
</a>
</div>
<div class="collection">
<a href="/ro/despre-noi/">
Despre Noi
</a>
</div>
<div class="folder">
<div class="folder-toggle" data-href="/ro/folder/servicii/">Servicii</div>
<div class="subnav">
<div class="collection">
<a href="/ro/corporate/">
Corporate
</a>
</div>
<div class="collection">
<a href="/ro/adulti/">
Adulti
</a>
</div>
<div class="collection">
<a href="/ro/copii-si-adolescenti/">
Copii si Adolescenti
</a>
</div>
<div class="collection">
<a href="/ro/cuplu-si-familie/">
Cuplu si Familie
</a>
</div>
<div class="collection">
<a href="/ro/lgbtq/">
LGBTQ
</a>
</div>
</div>
</div>
<div class="collection">
<a href="/ro/contact/">
Contact
</a>
</div>
<div class="sqs-block markdown-block sqs-block-markdown" data-block-type="44" id="block-yui_3_17_2_2_1515674166386_21002">
<div class="sqs-block-content" id="yui_3_17_2_1_1515676082589_298">
<div data-preserve-html-node="true" class="dropdown" id="yui_3_17_2_1_1515676082589_297">
<button data-preserve-html-node="true" onclick="myFunction()" class="dropbtn" id="yui_3_17_2_1_1515676082589_296">Language</button>
<div data-preserve-html-node="true" id="myDropdown" class="dropdown-content">
<a data-preserve-html-node="true" id="navEng" href="/en/index" class="language"><img data-preserve-html-node="true" id="imgNavEng" src="http://www.roemheld.de/IT/Data/Images/Address/Grossbritanien.gif" alt="ENG" class="img-thumbnail icon-small"></a>
<a data-preserve-html-node="true" id="navEng" href="/ro/index" class="language"><img data-preserve-html-node="true" id="imgNavEng" src="https://static1.squarespace.com/static/59f333cc49fc2b47eddb3379/t/5a44df2e08522979a70abfa9/1514463022027/ro.png" alt="ENG" class="img-thumbnail icon-small"></a>
<a data-preserve-html-node="true" id="navEng" href="/de/index" class="language"><img data-preserve-html-node="true" id="imgNavEng" src="https://static1.squarespace.com/static/59f333cc49fc2b47eddb3379/t/5a44dee6ec212d2c0937ff25/1514462950503/de.png" alt="ENG" class="img-thumbnail icon-small"></a>
<a data-preserve-html-node="true" id="navEng" href="/it/index" class="language"><img data-preserve-html-node="true" id="imgNavEng" src="https://static1.squarespace.com/static/59f333cc49fc2b47eddb3379/t/5a47dcde9140b7ea14e11002/1514659038936/it.png" alt="ENG" class="img-thumbnail icon-small"></a>
</div>
</div>
</div>
</div>
</nav>
You definitely need to work on CSS then to get it look right with its dropdown options.

How to hide the Menu bar only in a page

I just want to remove the tittle bar (header) (blue side part in image)inside this page.
my ionic code in about.html page
<nav-page hide-nav-bar="true">
<ion-view>
<ion-content class="app-view">
<div class="list-inset-feed">
<div class="item item-text-wrap">
<div class="row responsive-sm text-center">
<div class="col">
<h1 class="text-white">{{"about_page_title" | translate}}</h1>
<h3 class ="text-white">version 1.0.0</h1>
<div class="image_container">
<img alt="logo" height="100" src="img/logo.png">
</div>
<a class="text-white" href="#" onclick="window.open('http://abcd.html', '_system', 'location=yes'); return false;">
privacy policy
</a>
</div>
</div>
</div>
</div>
</ion-content>
Add hide-nav-bar="true" inside your <ion-view> tag.
HTML
<ion-view hide-nav-bar="true">
<ion-content >
</ion-content>
</ion-view>

Ionic where to put header and top navbar in ion-view?

I'm trying to put header and top navbar inside of the ion-view directive.
If I put header nav navbar outside of the ion-view tag page is blinking black if page is initialized.
But if I try to insert header and top navbar inside of the ion-view title and heading in the header is not displayed.
Could somebody tell me what I'm doing wrong?
Maybe some tag inside is missing?
Thanks for any help.
Here is the code of the template:
<div class="bar bar-header bar-positive has-tabs-top">
<button class="button button-icon icon ion-chevron-left" ui-sref="home">
</button>
<h1 class="title">{{ 'RESULTS_BY_DAY' | translate }}</h1>
<button class="button button-icon icon ion-stats-bars" ui-sref="daily-chart">
</button>
</div>
<!--TOP TAB BAR -->
<div class="tabs-striped tabs-top tabs-background-light tabs-light tabs-color-dark">
<div class="tabs">
<a class="tab-item orange">
Home
</a>
<a class="tab-item">
Favorites
</a>
<a class="tab-item">
Settings
</a>
</div>
</div>
<ion-view>
<div class="bar bar-header bar-positive has-tabs-top">
<button class="button button-icon icon ion-chevron-left" ui-sref="home">
</button>
<h1 class="title">{{ 'RESULTS_BY_DAY' | translate }}</h1>
<button class="button button-icon icon ion-stats-bars" ui-sref="daily-chart">
</button>
</div>
<!--TOP TAB BAR -->
<div class="tabs-striped tabs-top tabs-background-light tabs-light tabs-color-dark">
<div class="tabs">
<a class="tab-item orange">
Home
</a>
<a class="tab-item">
Favorites
</a>
<a class="tab-item">
Settings
</a>
</div>
</div>
<ion-content ng-controller="DailyListCtrl">
<!--WRITEOUT OVERAL STATS FOR DAYS -->
<ion-list class="list" >
<ion-item class="item itemListCustom" ng-repeat="listDataItem in listData">
<div class="listDateTimeBlock">
<div class="day"><h3>{{listDataItem.DATE_FROM_DD}}</h3></div>
<div class="month"><h3>{{listDataItem.DATE_FROM_MM}}</h3></div>
</div>
<!--ROW ONE -->
<div id="left">
<div class="left-inner">
{{ 'APPOINTMENT_SUCCESS_RATE' | translate }}:
</div>
<div class="right-inner">
{{listDataItem.SUCCESS_RATE}} %
</div>
</div>
<div id="right">
<div class="left-inner floatRight">
{{ 'DIALS' | translate }}:
</div>
<div class="right-inner">
{{listDataItem.DIALS_CNT}}
</div>
</div>
<!--ROW TWO-->
<div id="left">
<div class="left-inner ">
{{ 'SUCCESS_RATE_SINCE_START' | translate }}:
</div>
<div class="right-inner">
{{listDataItem.SUCCESS_RATE_SINCE}} %
</div>
</div>
<div id="right">
<div class="left-inner floatRight">
{{ 'CONVERSATIONS' | translate }} :
</div>
<div class="right-inner">
{{listDataItem.CONVERS_CNT}}
</div>
</div>
<!--ROW THREE-->
<div id="left">
<div class="left-inner">
{{ 'MY_DEFICIT' | translate }}:
</div>
<div class="right-inner">
{{listDataItem.DEFICIT}} %
</div>
</div>
<div id="right">
<div class="left-inner floatRight">
{{ 'APPOINTMENTS' | translate }} :
</div>
<div class="right-inner">
{{listDataItem.APPT_CNT}}
</div>
</div>
</ion-item>
</ion-list>
<ion-infinite-scroll
icon="ion-loading-c"
distance="30%"
on-infinite="setDateRange();">
</ion-infinite-scroll>
</ion-content>
<!-- BOTTOM TABS -->
<div class="tabs-striped tabs-background-positive tabs-light">
<div class="tabs">
<a class="tab-item active" ui-sref="daily-list" href="/#/daily-list">
<i class="icon ion-ios7-paper-outline"></i>
</a>
<a class="tab-item" ui-sref="weekly-list" href="/#/weekly-list">
<i class="icon ion-star"></i>
</a>
<a class="tab-item" ui-sref="daily-list" href="/#/daily-list">
<i class="icon ion-gear-a"></i>
</a>
<a class="tab-item" ui-sref="daily-list" href="/#/daily-list">
<i class="icon ion-gear-a"></i>
</a>
</div>
</div>
</ion-view>
Here are some examples of navbar usage:
Simple page with buttons left and right:
http://codepen.io/beaver71/pen/YwLELa
<ion-view title="onepage">
<ion-nav-buttons side="left">
<button class="button">
LeftButton
</button>
</ion-nav-buttons>
<ion-nav-buttons side="right">
<button class="button button-assertive">
RightButton
</button>
</ion-nav-buttons>
<ion-content class="padding">
<!-- The content of the page -->
</ion-content>
</ion-view>
Navigation via side menu:
http://codepen.io/beaver71/pen/XXBvYp
Navigation via side menu and tab bar:
http://codepen.io/beaver71/pen/xZWXBO
Try to use the JavaScript versions of tabs and navigation bars.
They are easier to be manipulated in JS code, because they come with the services $ionicTabsDelegate and $ionicNavBarDelegate.

Adding menu in a circular Position using Html

Hello i am trying to do something like this http://imgur.com/Ilu7ZM5 but instead of icons i am trying to place icons
my current html code is
<div>
<center>
<a href="#">
<button class="btn btn-success btn-lg">a</button></a>
</center>
<left><img src="img/arrow.png" alt="" width="250px" height="150px"/></left>
<br>
<br>
<left>
<button class="btn btn-warning btn-lg"><center>b</center></button>
</left>
<button class="btn btn-danger btn-lg">1</button>
<br>
<br>
<br>
<br>
<center> <button class="btn btn-success btn-lg">2</button><br><br></center>
</div>
how do i achieve that ?
Here you go. Demo includes a version with icons and a version with text. See the demo link for full code as there is an animation to the menus not seen in the screenshot below. If you'd like to use these, feel free to fork it..
Icons
<div class="wrap">
<div class="circle">
<i class="icon i1 icon-flag"></i>
<i class="icon i2 icon-heart"></i>
<i class="icon i3 icon-code"></i>
<i class="icon i4 icon-coffee"></i>
<div class="line1"></div>
<div class="line2"></div>
<span class="text">Menu</span>
</div>
</div>
Text
<div class="wrap2">
<div class="circle">
<i class="icon i1">A</i>
<i class="icon i2">B</i>
<i class="icon i3">C</i>
<i class="icon i4">D</i>
<div class="line1"></div>
<div class="line2"></div>
<span class="text">Menu</span>
</div>
</div>
See link for the full CSS code for both versions.. didn't post here because it's quite a bit.