Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherthielen committed Aug 8, 2020
1 parent 42eb751 commit cd162a3
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions src/directives/viewDirective.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ uiView = [
inherited = $element.inheritedData('$uiView') || rootData,
name = $interpolate(attrs['uiView'] || attrs['name'] || '')(scope) || '$default';

let previousEl: JQuery, currentEl: JQuery, currentScope: IScope, viewConfig: Ng1ViewConfig;
let previousEl: JQuery, currentEl: JQuery, currentScope: IScope;

const uiViewId = $view.registerView('ng1', inherited.$uiView.id, name, renderContentIntoUIViewPortal);

Expand Down Expand Up @@ -256,20 +256,9 @@ uiView = [

trace.traceUIViewEvent('Linking', activeUIView);

function renderContentIntoUIViewPortal(renderCommand: UIViewPortalRenderCommand) {
if (renderCommand.command === 'RENDER_DEFAULT_CONTENT') {
viewConfig = undefined;
} else if (renderCommand.command === 'RENDER_ROUTED_VIEW') {
viewConfig = renderCommand.routedViewConfig as Ng1ViewConfig;
} else if (renderCommand.command === 'RENDER_INTEROP_DIV') {
}

updateView(viewConfig);
}

$element.data('$uiView', { $uiView: activeUIView });

updateView();
renderContentIntoUIViewPortal({ command: 'RENDER_DEFAULT_CONTENT' });

function cleanupLastView() {
if (previousEl) {
Expand Down Expand Up @@ -297,13 +286,18 @@ uiView = [
}
}

function updateView(config?: Ng1ViewConfig) {
function renderContentIntoUIViewPortal(renderCommand: UIViewPortalRenderCommand) {
const viewConfig =
renderCommand.command === 'RENDER_ROUTED_VIEW'
? (renderCommand.routedViewConfig as Ng1ViewConfig)
: undefined;

const newScope = scope.$new();
const animEnter = $q.defer(),
animLeave = $q.defer();

const $uiViewData: UIViewData = {
$cfg: config,
$cfg: viewConfig,
$uiView: activeUIView,
};

Expand Down Expand Up @@ -354,7 +348,7 @@ uiView = [
*
* @param {Object} event Event object.
*/
currentScope.$emit('$viewContentLoaded', config || viewConfig);
currentScope.$emit('$viewContentLoaded', viewConfig);
currentScope.$eval(onloadExp);
}
};
Expand Down

0 comments on commit cd162a3

Please sign in to comment.