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

feat($templateFactory): refactor to a Provider to have a $http/$templateRequest switch #3204

Merged
merged 2 commits into from
Dec 15, 2016

Conversation

rjamet
Copy link

@rjamet rjamet commented Dec 15, 2016

This creates a $TemplateFactoryProvider to be able to set a global config option that forces $templateFactory to use $http (which bypasses the security checks, hence the scary name). Added tests and doc for that too. This still defaults to $http on older Angulars as expected.

Fixes the legacy part of #3193. Let me know if there's style issues or missing doc.

…ateRequest switch

This creates a $TemplateFactoryProvider to be able to set a global config option
that forces $templateFactory to use $http (which bypasses the security checks,
hence the scary name). Added tests and doc for that too. This still defaults to
$http on older Angulars as expected.
@christopherthielen
Copy link
Contributor

very nice, thanks! Can you fix the three linter errors?

https://travis-ci.org/angular-ui/ui-router/builds/184267215

Running "jshint:all" (jshint) task
Linting src/templateFactory.js ...ERROR
[L164:C2] W032: Unnecessary semicolon.
};
Linting build/angular-ui-router.js ...ERROR
[L613:C16] W055: A constructor name should start with an uppercase letter.
    return new $TemplateFactory($http, $templateCache, $injector, shouldUnsafelyUseHttp);}];
[L729:C2] W032: Unnecessary semicolon.
};

@rjamet
Copy link
Author

rjamet commented Dec 15, 2016

Yup, done. I removed the $ in the local names, it shouldn't change things since they're still provided with the right names, and that way, they can be lint-compliant constructors.

@christopherthielen christopherthielen merged commit d7fae8e into angular-ui:legacy Dec 15, 2016
@christopherthielen
Copy link
Contributor

Thanks very much! Let me know if you want to tackle porting to master. If not, I'll probably do it later this week or weekend.

@rjamet
Copy link
Author

rjamet commented Dec 15, 2016

Feel free to do it, I don't have much time in the next days. Thanks for maintaining this library!

@rjamet rjamet deleted the legacy branch December 16, 2016 10:48
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