1

Trying to work with Angular 1.4's new router and ng-link and coming across a naming issue that I don't understand.

I have a component that I'd like to name 'statOrders'. I've named the folder, .html, and .js files that same way - everything controllers etc. I tried to be very consistent in that naming/casing. I have setup my route as follows

{path: '/statOrders', component: 'statOrders' }

I am using an ng-link to go to that component as such:

<a ng-link="statOrders()"/>

I am getting an error that it cannot find 'stat-orders'. It is looking for a folder and js file with that naming.

I can get this to work if I just make the entire name lower case, but I'd rather not do that. I have tried a number of things trying to figure this out. Any guidance would be greatly appreciated.

I have read about the normalization of directive names, but cannot see how to apply this to this particular scenario.

1 Answer 1

2

This lets you override default conventions and configure how controllers are named and where templates are loaded from. https://angular.github.io/router/$componentLoaderProvider

An example out in the wild. http://chariotsolutions.com/blog/post/new-angular-router-naming-conventions/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.