Skip to content

dataService calls when inside page controllers vs component/directive controllers. #835

@s3y

Description

@s3y

I have a question open on stack overflow about this, but it basically boils down to this:

We have various pages containing directives / components.

At the minute, all our dataService calls are done within the pageController, then passing data to each directive via attr's.

My proposal is to shift the dataService calls to within the directives controller, thereby separating the component completely from its parent controllers, and means we can just call a component using a single html tag.

Is there a problem with architecting it in this manner?

This is the question on stack overflow which contains some code examples -> https://stackoverflow.com/questions/44258446/angular-project-architecture-controllers-directives-style-guides

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions