refactor(): reorganize source files

This commit is contained in:
Andy Joslin
2014-04-14 10:35:19 -06:00
parent ad8ea7a693
commit 14a2790749
192 changed files with 3407 additions and 5237 deletions

27
js/angular/controller/tabController.js vendored Normal file
View File

@@ -0,0 +1,27 @@
IonicModule
.controller('$ionicTab', [
'$scope',
'$ionicViewService',
'$attrs',
'$location',
'$state',
function($scope, $ionicViewService, $attrs, $location, $state) {
this.$scope = $scope;
//All of these exposed for testing
this.hrefMatchesState = function() {
return $attrs.href && $location.path().indexOf(
$attrs.href.replace(/^#/, '').replace(/\/$/, '')
) === 0;
};
this.srefMatchesState = function() {
return $attrs.uiSref && $state.includes( $attrs.uiSref.split('(')[0] );
};
this.navNameMatchesState = function() {
return this.navViewName && $ionicViewService.isCurrentStateNavView(this.navViewName);
};
this.tabMatchesState = function() {
return this.hrefMatchesState() || this.srefMatchesState() || this.navNameMatchesState();
};
}]);