<a class="seecode_button" href="#{{w.CouponID}}" ng-click="newwindow(w)" data-toggle="modal" data-target="#{{w.CouponID}}">CLICK Here</a>
$scope.newwindow = function(w) {
$window.open(w.LandingPageURL, '_self');
$window.open('#','_blank');
};
I am try to make when some one click on "CLICK Here" then need to open new window but need stay on current tab.
In my code current tab open in page its ok but popup also gone because of it refresh the page . I am using angular js 1.2.17 and for popup i am using bootstrap.js v3.0.0
If you don't want to refresh the page, then use an empty href attribute.
Related
Am i creating multiple html pages, where index.html consist of the bootstrap carousel which slided through some couple of images and am i connecting all the html pages through ngroute,The problem is when loading the carousel in index.html if click the next or prev button in the carousel it just navigating to the another html page or it's same page,i hereby paste a working plunker link for reference:
Please help me to resolve this issues.
Am i creating multiple html pages, where index.html consist of the bootstrap carousel which slided through some couple of images and am i connecting all the html pages through ngroute,The problem is when loading the carousel in index.html if click the next or prev button in the carousel it just navigating to the another html page or it's same page,i hereby paste a working plunker link for reference: http://plnkr.co/edit/VUS8RjQkVQabEBxRWMdB?p=info Please help me to resolve this issues.
just use this in your main controller
$scope.$on('$routeChangeSuccess', function () {
$scope.isIndexPage = $location.path() === '/';
});
I have an ionic app set up with 3 tabs (Tab1, Tab2 Tab3) and an ion-list with ion-items in each tab, with different data loaded.
If I open any one of the tabs initially (as in navigating to it from the address bar) they each work. But if I'm on the Home tab and switch to the Search tab, the ion-list doesn't appear. Similarly, if I start on the Search tab and go to the Home tab, the ion-list doesn't appear in the home tab.
The nav bar and tab bar do appear. It just doesn't show the ion-content.
The DOM is infact populated with the data. ion-content contains the ion-list with the ion-items with the HTML and data I want. They just for some reason don't visually appear (elements wit size and width of 0 as if they were empty)
If I resize the Safari window on desktop, the content suddenly appears perfectly.
Also If I start on one tab, switch to another, and then switch back, the content also appears perfectly.
The problem only occurs when testing in Safari on the desktop or in the app on iOS. Testing in Chrome and desktop and running the app on Android run it fine.
If I hardcode sample data and add it to the same array the ng-repeat uses the hardcoded data appears in the DOM correctly. Only when resizing the window or switching tabs makes the rest of the data appear.
The rest of the data is loading using $http.get()
Simple clicking and scrolling appear to not do anything. Only a page resize or switching tab makes the AJAX loaded data appear.
Calling $scope.$apply() or $scope.$digest don't appear to do anything.
The troubleshooting and debugging mentioned above makes me think its a bug with Ionic and/or AngularJS in rendering asynchronously loaded data. I'm wondering if anyone has a solution or work-around to this.
Relevant code:
Controller
angular.module('starter.PostListPlaceView', [])
.controller('PostListPlaceViewCtrl', function($scope, $http, PostFactory, Constants, $rootScope, $sce, linkify, SinglePostService, $stateParams, $timeout) {
function sendGetInitialPostsRequest(){
$http.get(Constants.GET_POSTS_URL, {params : paramObject})
.then(function (response){
$scope.posts = [];
for(var i = 0; i < response.data.resultsArray.length; i++){
var post = new PostFactory(response.data.resultsArray[i]);
console.log(post.desc);
}
$timeout(function() {
$scope.$digest();
console.log("$scope.$apply() called.");
}, 0);
$scope.$broadcast('scroll.refreshComplete');
$scope.$broadcast('scroll.infiniteScrollComplete');
});
}
});
Template:
<ion-content>
<ion-refresher pulling-text="Pull to refresh" on-refresh="doRefresh()">
</ion-refresher>
<ion-list>
<div ng-repeat="post in posts track by $index">
<ion-item class="post wrap" >
<div class="post-desc" ng-bind="post.desc"></div>
</ion-item>
</div>
</ion-list>
<ion-infinite-scroll on-infinite="getPosts()" distance="1%" ng-if="moreResults &&!loading">
</ion-infinite-scroll>
</ion-content>
As mentioned above, this code works perfectly in Chrome on desktop and Android, so I don't think its a logical/syntax error in my code itself.
Solved this by upgrading from Ionic 1.1.1 to Ionic 1.2
I want to close facebook feed dialog popup on click of cancel button.
Without redirect URL
I want to implement it in angularjs.!
I have feed dialog as shown in image.
I have to close dialog shown in image on click of Cancel button. But without help of redirect URL. (As it is not possible in my case to change URL)
Please click to see image
Use Facebook JS SDK's feed dialog.
FB.ui({
method: 'feed',
link: 'https://developers.facebook.com/docs/',
caption: 'An example caption',
}, function(response){});
I am trying to use modal dialog of bootstrap to ask for confirmation to navigate when the page is in edit mode.
I am using $locationChangeStart event to find out change in navigation. I am using a bool flag to find if the current page is in edit mode. In edit mode I should show the modal dialog on $locationChangeStart event trigger.
The dialog would contain Yes(To navigate away from the current page) or No(to stay on the same page).
I have used bootstrap modal dialog. My code would look like:
This is inside controller:
$scope.$on('$locationChangeStart', function (event, next, current) {
if (vm.isEditMode) {
event.preventDefault();
}
I have created a angular directive for modal dialog. How would I call event.preventDefault() inside directive, on click of "No" by the user?
From my home page am showing a popupdiv.on submiting the popup form i need my home page to redirect.but my popup form is redirecting . How to make my home page redirect, after completing controller function.
Now am using $this->redirect(home/action)
You'll need to get a reference to the homepage through java script from the pop-up win:
window.opener.location.href = "new page";