Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- define('app',[
- 'routes',
- // 'cordova',
- 'angular',
- 'angularRoute',
- 'angularResource',
- 'angularTouch',
- 'config',
- 'controllers',
- 'services',
- 'directives',
- 'helpers'
- ], function(appRoute) {
- var oApp = {
- _app: {},
- init: function() {
- console.log('init4');
- document.addEventListener('deviceready', this.onDeviceReady, false);
- },
- onDeviceReady: function() {
- oApp._app = angular.module('smartApp', [
- 'ngRoute',
- 'ngTouch',
- 'ngResource',
- 'smartAppConfig',
- 'smartAppServices',
- 'smartAppControllers',
- 'smartAppDirectives',
- 'smartAppHelpers'
- ]).config(appRoute).run(function ($rootScope, $route, $location) {
- $rootScope.passArgs = {};
- ang.rootScope = $rootScope;
- ang.route = $route;
- $rootScope.$on('$locationChangeSuccess', function (a, b, c) {
- for (var aArg in $rootScope.passArgs) {
- $route.current.params[aArg] = $rootScope.passArgs[aArg];
- delete $rootScope.passArgs[aArg];
- }
- $rootScope.oldOldLocPath = $rootScope.oldLocPath;
- console.log('$locationChangeSuccess changed!', '$route.current.params:', $route.current.params, 'event:', a, 'nowURL:', b, 'oldLocPath:', $rootScope.oldLocPath);
- $rootScope.oldLocPath = c.substr(c.indexOf('#')+1);
- //console.log('set rootscope old loc path:', $rootScope.oldLocPath);
- });
- });
- angular.element(document).ready(function() {
- angular.bootstrap(document, ['smartApp']);
- });
- }
- };
- return oApp;
- }
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement