Git Product home page Git Product logo

Comments (4)

homerjam avatar homerjam commented on July 21, 2024

Could you post the states you've declared in your app config please?

Which version of angular are you using?

If you could post a stripped down example somewhere that would greatly help.

Thanks

from angular-gsapify-router.

jake142 avatar jake142 commented on July 21, 2024

Hi,

I use:

AngularJS v1.4.0
Angular UI routier v0.2.15

This is my routing (I pretty much copied from the demo)

       (function() {
           'use strict';
        angular.module('myapp', ['ngTouch','ngCordova','ngAnimate', 'ui.router', 'hj.gsapifyRouter',     'myapp.controllers'])
      .config(['$stateProvider', '$locationProvider', '$urlRouterProvider', 'gsapifyRouterProvider',
    function($stateProvider, $locationProvider, $urlRouterProvider, gsapifyRouterProvider) {
        gsapifyRouterProvider.defaults = {
            enter: 'slideRight',
            leave: 'slideLeft'
           };
        //...more transitions here

        gsapifyRouterProvider.initialTransitionEnabled = true;
        $urlRouterProvider.otherwise("/");

        $stateProvider.state('signin', {
            url: '/',
            views: {
                main: {
                    templateUrl: 'templates/signin.html',
                    controller: 'SignInCtrl'
                }
            },
            data: {
                'gsapifyRouter.main': {
                    enter: {
                        'in': {
                            transition: 'fadeIn',
                            priority: 1
                        },
                        out: {
                            transition: 'fadeOut',
                            priority: 1
                        }
                    }
                }
            }
        });

        $stateProvider.state('menu', {
            url: '/menu',
            views: {
                main: {
                    templateUrl: 'templates/menu.html',
                    controller: 'MenuCtrl'
                }
            },
            data: {
                'gsapifyRouter.main': {
                    leave: {
                        out: {
                            transition: 'scaleDown',
                            priority: 2
                        }
                    }
                }
            }
        });
    }
]);
angular.module("myapp").run(["$templateCache", function($templateCache) {
    $templateCache.put("templates/menu.html", "<div class=\"wrapper\" style=\"background: #81B270\"><br><br><h1>Menu</h1><br><button ng-click=\"signOut()\">Sign out</button><a href=\"#/\">Sign out</a></div>");
    $templateCache.put("templates/signin.html", "<div class=\"wrapper\" style=\"background: #FF7F40\"><br><br><h1>Sign In</h1><br><button ng-click=\"signIn()\">Sign out</button><a href=\"#/menu\">Menu</a></div>");
}]);
})();

Also, I cant use templates on disk. I have to use $templateCache otherwise I get Error: undefined is not an object (evaluating 'state.data') when the first page loads.

from angular-gsapify-router.

homerjam avatar homerjam commented on July 21, 2024

Until I have some more time to test I think it'd be best to revert to angular 1.3. I believe ui-router still has some issues with 1.4 too - mainly due to breaking changes in the way $animate works

from angular-gsapify-router.

jake142 avatar jake142 commented on July 21, 2024

Thanks, that solved it.

from angular-gsapify-router.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.