Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

ng-cookie directive #1802

Closed
wants to merge 1 commit into from
Closed

ng-cookie directive #1802

wants to merge 1 commit into from

Conversation

mking
Copy link

@mking mking commented Jan 14, 2013

<input ng-model="name" ng-cookie="name">

This persists $scope.name to cookie['name'] whenever the model changes, deletes the cookie when the model goes undefined, and sets the initial value of $scope.name to cookie['name'].

(The cookie name is isn't generated from the model name because cookies have bigger scope (domain, path) than models (controller).)

@mhevery
Copy link
Contributor

mhevery commented Jan 17, 2013

I am sorry, but we are not going to merge this PR. We think this functionality should not be in the core of angular. It should be part of third party library which would add this behavior.

We think that the canonical way to sync input to cookie, it should be done through the controller.

Also the documentation and end to end test is lacking, which would create an empty documentation page on the docs.angularjs.org

If you feel strongly otherwise feel free to make a counter argument.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants