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

Injecting services/controllers and scope to components and handeling events #122

@benbro

Description

@benbro

I would like to suggest adding a chapter about injecting a service and a scope to components. These are important features needed by anything that is more than just an hello world example.

It's not clear to me when to inject a controller, a service and a scope.
A should be injected only to the controller and a component that wants to send data to the server should call the controller that calls the service or should the component use the service directly?
When do I want to use data-binding and when to inject the scope? Injecting the scope is only needed when we need to listen to or send events (emit/broadcast)?

Injecting a controller might be demonstrated for saving recipe rating to the server?
A dummy saveRating method on the controller could maybe use localStorage for the tutorial.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions