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

option to create/navigate to a controller from ng-controller #20

Open
kkozmic opened this issue Jan 11, 2014 · 11 comments
Open

option to create/navigate to a controller from ng-controller #20

kkozmic opened this issue Jan 11, 2014 · 11 comments
Milestone

Comments

@kkozmic
Copy link
Contributor

kkozmic commented Jan 11, 2014

Those are effectively two features, so I'm happy to split it into two requests:

One is to be able to write ng-controller="FooController" or ng-controller="FooController as vm" and have an option to alt + Enter to create a new controller with this name.

Second one would be to navigate to definition when the controller exists.

@citizenmatt
Copy link
Member

This is similar to PR #11, which would add a reference between the value of the ng-controller attribute and the controller function in JavaScript. Adding a reference enables the ctrl+click navigation, (mostly) code completion when editing, and partaking in renaming. @DerAlbertCom has done some work on this already - Albert, it would be great if you could do a new PR with your changes, even if they're unfinished.

The second part, create from usage, isn't covered and will have to be a separate piece of work. How would you expect it to work - where would it create the controller? In the HTML file, or in a new file, alongside, or in the scripts folder?

@kkozmic
Copy link
Contributor Author

kkozmic commented Jan 20, 2014

re: 2nd part

I realise that's not everybody's preference, but the way I structure the code is having them side by side:

/shoppingCart/
    shoppingCart.html
    shoppingCartController.js

That would obviously be my preference.

@citizenmatt
Copy link
Member

Is there a convention in angularjs world (I'm not familiar enough)?

@kkozmic
Copy link
Contributor Author

kkozmic commented Jan 20, 2014

I'm not sure,,, haven't seen any strong guidance around that, but I'm quite new to Angular myself, and figuring it out as I go

@DerAlbertCom
Copy link
Contributor

No it is not a convention. most from what i see put the view in seperate folders

@DerAlbertCom
Copy link
Contributor

@citizenmatt i think on the weekend i can work in the plugin

@DerAlbertCom
Copy link
Contributor

btw. the "other" guys uses often yeoman

For an example of the structure look here.

http://www.sitepoint.com/kickstart-your-angularjs-development-with-yeoman-grunt-and-bower/

@citizenmatt
Copy link
Member

Hi @DerAlbertCom - any movement on the PR? I'm going to need an ICache implementation soon. I'm happy if you just want to push what you've got.

@citizenmatt citizenmatt modified the milestones: v1.3, v1.2 Apr 2, 2014
@citizenmatt
Copy link
Member

@DerAlbertCom, are you ok if I cherry pick some of those commits? I want to get back onto this, but the project's changed a lot since the branch started, so I think it might be easier to pull in the most relevant commits and work from there. How does that sound?

@DerAlbertCom
Copy link
Contributor

Pick it.

@citizenmatt citizenmatt modified the milestones: v1.3, v1.4 Jun 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants