Skip to content

added support for controllerAs with function variables instead of string #808

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

Merged
merged 1 commit into from
Jan 28, 2014

Conversation

seanhess
Copy link
Contributor

This is needed in addition to the "MyController as vm" syntax because I need to reference the controller as a function instead of a string. This is not possible currently.

Now, by setting controllerAs in the state it will work. $stateProvider.state("name", {url:"/url", controller: MyController, controllerAs:"vm"})

This brings it in line with how angular-router works too.

https://github.com/angular/angular.js/blob/master/src/ngRoute/directive/ngView.js#L263

@nateabele
Copy link
Contributor

Thanks I'll merge it as soon as I can write a test (unless you want to).

@seanhess
Copy link
Contributor Author

Awesome. If it's not too much trouble for you, that would be great. I had
trouble getting the test suite working. I'll update the wiki as soon as you
merge.

Thanks!

On Thu, Jan 23, 2014 at 11:40 AM, Nate Abele [email protected]:

Thanks I'll merge it as soon as I can write a test (unless you want to).


Reply to this email directly or view it on GitHubhttps://github.com//pull/808#issuecomment-33154231
.

@nateabele
Copy link
Contributor

Awesome. If it's not too much trouble for you, that would be great.

Should be fine, but it'll probably be a while before I have a chance to get to it.

I had trouble getting the test suite working.

If you're having issues here, please hit up the appropriate support channels, and/or file an issue so we can get it resolved. Thanks!

Btw, enjoyed your talk on TypeScript last week.

@seanhess
Copy link
Contributor Author

Thank you! I just pushed a test. I guess I didn't have phantom running properly yesterday and it magically works today :)

@nateabele
Copy link
Contributor

Test looks good, but one final point of pedantry (sorry): please see the contributor guidelines on the correct formatting of commit messages. Once that's done and you've squashed your commits, I can merge this.

@seanhess
Copy link
Contributor Author

If I didn't know any better I'd say you guys almost don't want any pull requests :D Done.

@nateabele
Copy link
Contributor

Har har. :-) We're just trying to follow Angular core conventions. Btw, should actually be feat(uiView): ....

need to support function pointers so we can pass them in
@seanhess
Copy link
Contributor Author

Good? Can we merge?

nateabele added a commit that referenced this pull request Jan 28, 2014
added support for controllerAs with function variables instead of string
@nateabele nateabele merged commit f17b587 into angular-ui:master Jan 28, 2014
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.

2 participants