Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// 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