mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-14 17:53:11 +00:00
docs($location): fix $config -> $locationConfig in docs
This commit is contained in:
parent
718741acab
commit
7a19eb84aa
2 changed files with 10 additions and 10 deletions
|
|
@ -88,8 +88,8 @@ setter methods that allow you to get or change the current URL in the browser.
|
||||||
|
|
||||||
## $location service configuration
|
## $location service configuration
|
||||||
|
|
||||||
To configure the `$location` service, you define the `$config` service which is an object with
|
To configure the `$location` service, you define the `$locationConfig` service which is an object
|
||||||
configuration properties:
|
with configuration properties:
|
||||||
|
|
||||||
- **html5Mode**: {boolean}<br />
|
- **html5Mode**: {boolean}<br />
|
||||||
`true` - see Html5 mode<br />
|
`true` - see Html5 mode<br />
|
||||||
|
|
@ -102,7 +102,7 @@ configuration properties:
|
||||||
|
|
||||||
### Example configuration
|
### Example configuration
|
||||||
<pre>
|
<pre>
|
||||||
angular.service('$config', function() {
|
angular.service('$locationConfig', function() {
|
||||||
return {
|
return {
|
||||||
html5mode: true,
|
html5mode: true,
|
||||||
hashPrefix: '!'
|
hashPrefix: '!'
|
||||||
|
|
@ -205,7 +205,7 @@ In this mode, `$location` uses Hashbang URLs in all browsers.
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
angular.service('$config', function() {
|
angular.service('$locationConfig', function() {
|
||||||
return {
|
return {
|
||||||
html5Mode: false,
|
html5Mode: false,
|
||||||
hashPrefix: '!'
|
hashPrefix: '!'
|
||||||
|
|
@ -253,7 +253,7 @@ having to worry about whether the browser displaying your app supports the histo
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
angular.service('$config', function() {
|
angular.service('$locationConfig', function() {
|
||||||
return {
|
return {
|
||||||
html5Mode: true,
|
html5Mode: true,
|
||||||
hashPrefix: '!'
|
hashPrefix: '!'
|
||||||
|
|
@ -456,7 +456,7 @@ ng:ext-link>external</a>
|
||||||
function initEnv(name) {
|
function initEnv(name) {
|
||||||
var root = angular.element(document.getElementById(name + '-mode'));
|
var root = angular.element(document.getElementById(name + '-mode'));
|
||||||
var scope = angular.scope(null, {
|
var scope = angular.scope(null, {
|
||||||
$config: {html5Mode: true, hashPrefix: '!'},
|
$locationConfig: {html5Mode: true, hashPrefix: '!'},
|
||||||
$browser: browsers[name],
|
$browser: browsers[name],
|
||||||
$document: root,
|
$document: root,
|
||||||
$sniffer: {history: name == 'html5'}
|
$sniffer: {history: name == 'html5'}
|
||||||
|
|
|
||||||
|
|
@ -400,7 +400,7 @@ function locationGetterSetter(property, preprocess) {
|
||||||
*
|
*
|
||||||
* @requires $browser
|
* @requires $browser
|
||||||
* @requires $sniffer
|
* @requires $sniffer
|
||||||
* @requires $config
|
* @requires $locationConfig
|
||||||
* @requires $document
|
* @requires $document
|
||||||
*
|
*
|
||||||
* @description
|
* @description
|
||||||
|
|
@ -419,14 +419,14 @@ function locationGetterSetter(property, preprocess) {
|
||||||
*
|
*
|
||||||
* For more information see {@link guide/dev_guide.services.$location Developer Guide: Angular Services: Using $location}
|
* For more information see {@link guide/dev_guide.services.$location Developer Guide: Angular Services: Using $location}
|
||||||
*/
|
*/
|
||||||
angularServiceInject('$location', function($browser, $sniffer, $config, $document) {
|
angularServiceInject('$location', function($browser, $sniffer, $locationConfig, $document) {
|
||||||
var scope = this, currentUrl,
|
var scope = this, currentUrl,
|
||||||
basePath = $browser.baseHref() || '/',
|
basePath = $browser.baseHref() || '/',
|
||||||
pathPrefix = pathPrefixFromBase(basePath),
|
pathPrefix = pathPrefixFromBase(basePath),
|
||||||
hashPrefix = $config.hashPrefix || '',
|
hashPrefix = $locationConfig.hashPrefix || '',
|
||||||
initUrl = $browser.url();
|
initUrl = $browser.url();
|
||||||
|
|
||||||
if ($config.html5Mode) {
|
if ($locationConfig.html5Mode) {
|
||||||
if ($sniffer.history) {
|
if ($sniffer.history) {
|
||||||
currentUrl = new LocationUrl(convertToHtml5Url(initUrl, basePath, hashPrefix), pathPrefix);
|
currentUrl = new LocationUrl(convertToHtml5Url(initUrl, basePath, hashPrefix), pathPrefix);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue