In Angularjs which of ng-clikc and href has higher priority - ionic-framework

Let's say that i have this tag :
<a ng-click="leavingMenuPage()" href="#/app/interview" >
<i class="icon ion-android-person"></i>
<p class="pFont" >Görüşme</p>
</a>
Does ng-click will be called first or it will go to the link defined before ??

Related

Selenium- Tag traversal Xpath for facebook First name not working

<div id="reg_form_box" class="large_form">
<div class="clearfix _58mh">
<div class="mbm _3-90 lfloat _ohe">
<div id="u_0_0" class="_5dbb">
<div class="uiStickyPlaceholderInput uiStickyPlaceholderEmptyInput">
<div class="placeholder" aria-hidden="true">First name</div>
<input id="u_0_1" class="inputtext _58mg _5dba _2ph-" data-type="text" name="firstname" aria-required="1" placeholder="" aria-label="First name" aria-controls="js_0" aria-haspopup="true" role="null" aria-describedby="js_w" aria-invalid="true" type="text"/>
</div>
<i class="_5dbc img sp_beZQzZ7Rg6Q sx_5ca7f2"/>
<i class="_5dbd img sp_beZQzZ7Rg6Q sx_9c246c"/>
</div>
Above is the code for which i want to write Xpath using tag name traversal. Here is the xpath i have made
"//div[#id='reg_form_box']/div[1]/div[1]/div[1]/div/input"
Please suggest what's wrong here and how can i correct the same. Website is Facebook and field is First name on homepage.
Ideally unless you have a case of multiple modes that match the same xpath, you don't have to traverse through the entire hierarchy.
This will work:
//input[#name='firstname']

How can specify negation of ion-tabs?

I am new in ionic, I try to use ion-tabs to navigate, but I am facing some problem with it, my application have two tags "Home" and "Option", "Home" have Sub tabs
tag
_______|_________
| |
Home option
|
sub
my problem is:
When I navigate from "Home" tag to Sub tag, then navigate to "Option tag" and try to return to "Home" tag, I return to sub tag not to "Home" tag.
How can I return to "Home" tag not to Sub tag
This is per design, as every single tab has its own history stack. If you want to use single stack for all tabs, you can't use ion-tabs directive, you have to make it up on your own.
Example by jason-engage from github issue (change as appropriate):
<ion-view class="tabs-container">
<!-- Single UI VIEW -->
<ion-nav-view name="tabview"></ion-nav-view>
<!-- TABS -->
<div class="tabs tabs-icon-top">
<a class="tab-item" ng-click="goTab1()" ng-class="{ active : settings.isTab1}">
<i class="icon ion-ios-flame"></i> Tab1
</a>
<a class="tab-item" ng-click="goTab2()" ng-class="{ active : settings.isTab2 }">
<i class="icon ion-ios-location"></i> Tab2
</a>
<a class="tab-item" ng-click="goTab3()" ng-class="{ active : settings.isTab3, 'has-badge' : settings.numberOfBadges != 0 }">
<i class="icon ion-ios-chatboxes"></i> Tab3 <span class="badge badge-assertive" ng-if="settings.numberOfBages != 0">{{settings.numberOfBadges}}</span>
</a>
<a class="tab-item" ng-click="goTab4()" ng-class="{ active : settingsTab4}">
<i class="icon ion-ios-people"></i> Tab4
</a>
</div>
</ion-view>

How do I put an icon in the title on an Angular-Strap tab?

I would like an angular-strap tab title to have an icon-font an then the text for the title.
The resulting html for the tab list would have to have an li that looks like the following.
<li class="ng-scope active" ng-class="$index == $panes.$active ? $activeClass : ''" ng-repeat="$pane in $panes">
<a class="ng-binding" role="tab" ng-click="$setActive($index)" data-toggle="tab" ng-bind-html="$pane.title" data-index="0">
<i ng-show="loading" class="fa fa-spinner fa-spin"></i> Home
</a>
</li>
How do I express this in angular-strap?
It's very easy to do in strait bootstrap.
You can use escaped html.
So, putting something like this in the title will display the icon
<i ng-show="loading" class="fa fa-spinner fa-spin"></i> Home

protractor by.repeater how to find sibling elements

I want to get the text for all the elements where the icon has error (don't want the one with warning) with class="dropdown-item-icon ctp-img-notification-error"
How can I get that?
In this case I only want the text "unable to load Data", since that is an error
<li ng-repeat="option in options" class="dropdown-item ng-scope">
<a href ng-class="{ selected : isSelected(option)}" ng-click="selectItem(option)">
<div data-ng-if="option.iconCls" class=ng-scope">
<div class="dropdown-item-icon ctp-img-notification-error" data-ng-class="options.iconCls"></div>
<div class="ng-binding">unable to load Data</div>
</div>
</a>
<a href ng-class="{ selected : isSelected(option)}" ng-click="selectItem(option)">
<div data-ng-if="option.iconCls" class=ng-scope">
<div class="dropdown-item-icon ctp-img-notification-warning" data-ng-class="options.iconCls"></div>
<div class="ng-binding">using cache Data</div>
</div>
</a>
</li>
My first thought looks like this:
var errorMessages = [];
element.all(by.css('.dropdown-item-icon.ctp-img-notification-error .ng-binding')).then(function(items) {
items.forEach(function(item) {
item.getText().then(function(message) {
errorMessages.push(message);
});
});
});

AddThis toolbox multiple times

How can I do addthis.toolbox('.addthis_toolbox') multiple times?
I have a list of posts, and each is opened in popup window (jquery ui dialog). So I need to reload AddThis bar for each post.
Now I have:
<div id="addThis_<?=$postID?>" class="addthis_toolbox addthis_default_style" addthis:title="<?=$fullTitle?>" addthis:url="https://<?=$url?>">
<a class="share-button addthis_button_preferred_1"></a>
<a class="share-button addthis_button_preferred_2"></a>
<a class="share-button addthis_button_preferred_3"></a>
<a class="share-button addthis_button_preferred_4"></a>
<a class="share-button addthis_button_twitter" addthis:title="<?=$fullTitle?>" addthis:url="http://lj.is/<?=$postID?>"></a>
<a class="addthis_button_compact"></a>
<a class="addthis_counter addthis_bubble_style"></a>
</div>
<script type="text/javascript">
$(function(){
var addthis_config = {
data_track_clickback:true,data_track_addressbar:true,pubid:'...',ui_delay:300
};
var addthis_share = {url:"https://<?=$url?>", title:'<?=$fullTitle?>'};
if (window.addthis) {addthis.toolbox('#addThis_<?=$postID?>'); addthis.button("#addThis_<?=$postID?> .share-button"); addthis.counter("#addThis_<?=$postID?> .addthis_bubble_style");}
else $.getScript('https://s7.addthis.com/js/300/addthis_widget.js#pubid=...&async=1', function(){addthis.init();});
})
</script>
Now first launch is ok. But next - bar is built, but without correct click, anchor title and etc.
You can see that on https://littlejoys.ru/
And additional problem - compact menu has incorrect position when my popup window is scrolled.
You can repeat the div multiple times. But you need to change the URL, title, description using Addthis optional attributes (addthis:url, addthis:title, addthis:description).
<!-- First Post -->
<div class="addthis_toolbox addthis_default_style" addthis:url="http://example.com/1"
addthis:title="My cool first post"
addthis:description="An Example Description 1">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_preferred_3"></a>
<a class="addthis_button_preferred_4"></a>
<a class="addthis_button_compact"></a>
<a class="addthis_counter addthis_bubble_style"></a>
</div>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=***"></script>
<!-- Second Post-->
<div class="addthis_toolbox addthis_default_style" addthis:url="http://example.com/2"
addthis:title="My hot second post"
addthis:description="An Example Description 2">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_preferred_3"></a>
<a class="addthis_button_preferred_4"></a>
<a class="addthis_button_compact"></a>
<a class="addthis_counter addthis_bubble_style"></a>
</div>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=***"></script>
Therefore you can add it in a loop and it will pick up the correct data.
If Addthis is not getting re-initialized in UI dialog then you need to re-initialize the addthis buttons again using addthis.button(".share-button")
where share-button is the class of the addthis share anchor link.
Check this Addthis article: http://support.addthis.com/customer/portal/articles/1365325-rendering-tools-with-javascript