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

Commit c0cce8e

Browse files
Corey Cacicpetebacondarwin
Corey Cacic
authored andcommitted
docs($cookiesProvider): add example for overwriting defaults on provider
Add an example on how to set default values on `$cookiesProvider`. Many similar services support overriding the `defaults` object with a new one, but this service only supports changing individual properties. Closes #15362
1 parent c8d83e7 commit c0cce8e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/ngCookies/cookies.js

+10
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ angular.module('ngCookies', ['ng']).
4646
* Note: By default, the address that appears in your `<base>` tag will be used as the path.
4747
* This is important so that cookies will be visible for all routes when html5mode is enabled.
4848
*
49+
* @example
50+
*
51+
* ```js
52+
* angular.module('cookiesProviderExample', ['ngCookies'])
53+
* .config(['$cookiesProvider', function($cookiesProvider) {
54+
* // Setting default options
55+
* $cookiesProvider.defaults.domain = 'foo.com';
56+
* $cookiesProvider.defaults.secure = true;
57+
* }]);
58+
* ```
4959
**/
5060
var defaults = this.defaults = {};
5161

0 commit comments

Comments
 (0)