How to use the @uirouter/core.Transition function in @uirouter/core

To help you get started, we’ve selected a few @uirouter/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ergo / polymer-ui-router / uirouter-uiview.js View on Github external
// a state is targeting this uiview
        // Now we need to use the `newConfig` data to
        // update which component is inside this ui-view
        let componentType = (newConfig && newConfig.viewDecl.component) || this.component || "";
        let isAbstract = (newConfig && newConfig.viewDecl['$context'].self.abstract === true);
        if (isAbstract){
            componentType = 'uirouter-uiview'
        }
        let child = this.firstChild;
        if (child !== null) {
            this.removeChild(child)
        }
        if (componentType.length > 0) {
            let elem = document.createElement(componentType);
            if (!this.doNotAttachRouterInfo) {
                let Transition = routerCore.Transition;
                let ResolveContext = routerCore.ResolveContext;
                let resolveContext = new ResolveContext(newConfig.path);
                let transition = resolveContext.getResolvable(Transition).data;
                let tokens = [];
                let resolvedData = {};
                if (transition) {
                    tokens = transition.getResolveTokens().filter(
                        function (token) {
                            return typeof token === 'string';
                        });
                    tokens.forEach(function (token) {
                        resolvedData[token] = transition.injector().get(token);
                    });
                }
                Object.keys(resolvedData).filter(function (key) {
                    return ["$transition$", "$stateParams", "$state$"].indexOf(key) === -1