Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider registering controllers using the interface they implement as the name #4

Open
DamianEdwards opened this issue Apr 29, 2014 · 0 comments

Comments

@DamianEdwards
Copy link
Owner

Might make more sense to register controllers using the interface they implement (if any) instead of the class name. Means that HTML views would refer to them by the interface name, e.g.

module MyApp {
    interface IHelloViewModel {
        message: string;
    }

    class HelloController implements IHelloViewModel {
        constructor() {
            this.message = "Hello";
        }

        public message: string;
    }
}
<div ng-controller="MyApp.IHelloViewModel as vm">
   {{ vm.message }}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant