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

feat(1.x): support routing to a directive #161

@davej

Description

@davej

If the router supported 'component-based' directives (including the directive's template) then it would give a nice path for migrating controllers/components to angular 2.0.

Any thoughts on achieving something like below?:

angular.module('app', ['ngNewRouter'])
  .directive('componentDirective', function() {
    return {
      templateUrl : 'componentDirective.html',
      controllerAs : 'ctrl',
      controller : function() {
        // Controller here
      }
    }
  });
  .controller('AppController', function($router) {
    $router.config([
      {path: '/', component: 'componentDirective' }
    );
  });

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions