Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Way to prevent initial template rendering #1396

@vojtech-dobes

Description

@vojtech-dobes

After some tries to think differently or redefine my problem, I'm still stucked with seeking this (how I believe) simple feature request. My use case:

  • I have classic Controllers, one ng-view, some routes

Even with inlined templates (via <script type-"text/ng-template">...), application flashes little bit before it loads. I would like to prevent that by preparing the initial html on server. Then just bind all event listeners and stuff, and all other changes handle by angular. I want to run the Controller code for initial matched route, but I don't want Angular to apply template - it's unnecessary, I have it as I want from server. I want Angular to render all other pages, but not the first one.

I am new to Angular and not sure, if I suggest propriate API, but something like this I would found ideal:

$routeProvider.when('page/:id', {
    controller: 'PageController',
    templateUrl: 'view.html',
    renderOnFirstLoad: false // default value: true
});

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions