Skip to content

Support Directive dependency aliases #1747

Closed

Description

@kegluneq

I had a request for directive aliases, for example:

shared.js

export SHARED_DEPS = [Dep1, Dep2, Dep3];

component1.js

import {SHARED_DEPS} from 'shared.js';

@Component({...})
@View({directives: SHARED_DEPS})
class Component1 {...}

component2.js

import {SHARED_DEPS} from 'shared.js';
import {AdditionalDep} from 'component2_deps.js';

@Component({...})
@View({directives: [SHARED_DEPS, AdditionalDep]})
class Component2 {...}

Component1 would depend on Dep1, Dep2, and Dep3, while Component2 would be those as well as AdditionalDep.

@yjbanov , @mhevery , does Angular 2 Js already support this?

Activity

  1. added
    featureLabel used to distinguish feature request from other issues
    on May 7, 2015
  2. yjbanov commented on May 10, 2015

    @yjbanov
    Contributor

    This should already be supported in reflective mode. There's a bit of a debate going about the directives field. Not 100% sure directives are here to stay. Let's wait until the dust settles on the topic.

  3. pkozlowski-opensource commented on May 10, 2015

    @pkozlowski-opensource
    Member

    Right, currently there is logic to flatten directives list:

    _flattenDirectives(template: View):List<Type> {

  4. mhevery commented on Jun 1, 2015

    @mhevery
    Contributor

    Obsolete. Already supported.

  5. kegluneq commented on Jun 2, 2015

    @kegluneq
    Author

    Not yet supported when running statically in the transformer.

  6. kegluneq commented on Jul 14, 2015

    @kegluneq
    Author
  7. self-assigned this
    on Jul 17, 2015
  8. added this to the alpha-33 milestone on Jul 17, 2015
  9. 8 remaining items

  10. sigmundch commented on Jul 21, 2015

    @sigmundch
    Contributor

    will do, thanks!

  11. angular-automatic-lock-bot commented on Sep 6, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  12. locked and limited conversation to collaborators on Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: commonIssues related to APIs in the @angular/common packageeffort2: daysfeatureLabel used to distinguish feature request from other issues

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions