md-on-select called on every md-tab during destroy - angularjs

We are using angular-material's md-tabs to display information to the user.
Up until now we used an on-demand approach by adding
ng-click=vm.getForExampleDataForTab1(),
ng-click=vm.getForExampleDataForTab2()
and so on for each md-tab. But this solution has a problem that the first tab is displayed with no data because it doesn't get clicked by the user. So we switched to md-on-select instead. And that did the trick, the first tab was getting data and all was fine. Apparently. We then discovered in Chrome's Dev tools that when moving to another page in the app, all the other tabs that were not selected (the user didn't click on them to view the data) were called.
Did anyone encounter such a behaviour? It only happens when we used md-on-select, not ng-click on the tabs.
Thanks a lot,
ashilon

Related

Uncaught ReferenceError: $scope is not defined(…)

After inspecting an element, I see this very often-
I then have to switch over to AngularJS tab in Google Chrome and then click the checkbox Enable as seen clearly in the attached image. I don't know why it keeps on switching off after sometime.
It does have a material impact atleast on the application I am working. The moment I switch over to AngularJS tab (so as to enable the very same checkbox aforementioned), the whole application gets refreshed (Ctrl+F5) automatically gets invoked.
It's a disaster for me as the application which I am developing has around 5 to 6 steps. And I do have to cry when I have to inspect an element on step6 and when sometimes there is: $scope is not defined. All the values gets lost since after automatical refresh, the application swill get navigated to step-1.
This happens with the browsers for all the fellow associates in the team. This just makes us nervous.
Kindly suggest.

ng-click triggering twice in iOs divice only

I am using ng-click for div which will filter the data. I am using collection-repeat to show large data.
When the data is less, the click only triggers once, but when the data is huge, the click triggers twice. I tried using fastclick.js but didn't work out. I have only added angularjs once through ionic.bundle.min.js.
I can't put the demo as this is confidential project.
And also, THIS PROBLEM ONLY OCCURS IN IOS, NOT IN ANDROID AND PC
Yes there is problem, sometimes ng-click fires twice.
please check: https://github.com/driftyco/ionic/issues/1022
they have suggested multiple solutions

AngularJS window does not render (blank page) but resizing window renders it

I have this weird issue with my angular app. It doesn't happen every time but I've been able to consistently reproduce it if I click to it as quickly as I can as soon as my angularjs app loads.
Basically my right pane directive will sometimes render a blank page. This page however appears when I resize the browser window a little bit.
I'm not even sure where to begin looking to resolve this bug. I tried messing around with $timeout and $scope.$apply but it didn't seem to do anything.
Has anyone seen anything like this before and if so, how did you resolve it?
Note the directive I use does use ng-include with a value that is dynamically generated from the custom directive's associated controller.
P.S. Another oddity, if I move my mouse over the allow main dock then it loads the page too. (I assume it's doing an unfocus action on the browser window.) I wanted to see if this was a browser specific issue because of this. Looks like it's only Chrome where this is a problem, as I can't reproduce the problem on firefox.
Same problem caused by CSS - display: table, found a solution by changing it to display: inline-block, so check if you have a such.

Angular Material form scrolls down on page load

I created a long form using Angular Material. Weird thing is that instead of the page displaying normally it starts off midway through the form.
Is this something my browser is doing (Perhaps it thinks I left off at a certain point last time)?
Not sure how to force the page to load normally and start from the top.
Has anyone encountered this before?
I was able to track down the issue and it was the md-autocomplete field causing the page to scroll down. To fix this I added md-autofocus="false" in the md-autocomplete field and now it loads normally.

Tab control in Silverlight 3.0 and Dirty data

We are using tab control in our project. While using this control i came across a few issues like
- When the tab control loads, it invokes constructor of all the xaml pages that form the individual tabs. Can this be avoided?
Is there any event with tab control that we can use to identify dirty data on the previous tab that i may have visited. I mean can i prevent user from navigating to some other tab before saving the changes on current tab.
You should be able to avoid the instantiation of each xaml page in the individual tabs by adding the content to the tabs dynamically, right before they are shown for the first time. You might be able to get away with doing this on the tab control's SelectionChanged event.
The tab control does not have a dirty state management. At best, you individual containers/pages will have to handle the dirty state.
I mean can i prevent user
from navigating to some other tab
before saving the changes on current
tab.
I don't think you can prevent it. We have something similar in our app and the route we have chosen is if the page is validated then the Tabs becomes enabled so they can either click save or navigate to a different tab. In case they navigate to a different tab without clicking on save we will perform save for them. I think as a user perspective this is a good thing!

Resources