Skip to content

Feature: Route to Component Directive #1989

@timkindberg

Description

@timkindberg

Angular is fully heading to a component-driven architecture. The Angular 1.4 and 2.0 router (same router) will allow routing to components (aka directives with a template and controller). This was actually a great idea from the core team! It makes a lot of sense. I think ui-router would benefit from being able to route to a 'component' as well. With the new angular.component proposal it will be easier for the average developer to make components.

E.g.

$stateProvider.state('home', {
    url: '/',
    component: 'home'
})

angular.directive('home', function(){
    return {
        template: `<h1>Home Sweet Home</h1>
                         <ui-view></ui-view>`,
        controller: function($state) {
        }
    }
})

Just an idea...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions