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

Issue 316 #325

Closed
wants to merge 6 commits into from
Closed

Issue 316 #325

wants to merge 6 commits into from

Conversation

jeffarese
Copy link
Contributor

@jeffarese jeffarese commented Jun 2, 2016

What does this PR do?

This changes the way directives are created to use TypeScript classes when using the controllerAs syntax.

If the project uses controllerAs syntax, it creates the class and binds it as a controller to the directive object.

If the project don't use controllerAs syntax, it just creates the function as before, but creates the custom scope typing as an interface, extending the ng.IScope object.

Where should the reviewer start?

It should see that the directives are now using classes when using controllerAs

How should this be manually tested?

  • Create a new project
  • Select TypeScript and controllerAs
  • Create a new directive
  • Check that the created directive is using a class as a controller, which has a name and $inject properties.
  • Check that the directive works correctly and can be used in a template
  • Create a new project
  • Select TypeScript and NOT controllerAs
  • Create a new directive
  • Check that the created directive is uses a function, with the proper Interface created for the typedef

Documents

Example of a directive named exampleComponent created with controllerAs syntax:

screenshot from 2016-06-02 12-41-47

@coveralls
Copy link

coveralls commented Jun 2, 2016

Coverage Status

Coverage remained the same at 97.983% when pulling 78c0bf0 on Jeffarese:issue-316 into ca02595 on dustinspecker:master.

@dustinspecker
Copy link
Owner

Thank you so much for this pull request! I really, really appreciate the work put into it and the description!

I'll try to review this later tonight/tomorrow. I apologize for the delay.

@jeffarese
Copy link
Contributor Author

You're welcome 😉

I'm using this generator on a big SPA with Angular 1.x and TypeScript and I want to help a little with the TypeScript support 😄

@dustinspecker
Copy link
Owner

dustinspecker commented Jun 14, 2016

Thank you very much for this PR! I apologize for the very late delay in getting this merged.

This has been rebased into master and will be released as soon as CI finishes.

@jeffarese
Copy link
Contributor Author

No problem ;) happy to provide a little support!

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

Successfully merging this pull request may close these issues.

3 participants