Skip to content

Commit

Permalink
Updated docs files.
Browse files Browse the repository at this point in the history
  • Loading branch information
puckowski committed Nov 27, 2019
1 parent cd4d424 commit e564cb2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
13 changes: 9 additions & 4 deletions docs/api-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ __void s.clearAutoUpdate ( rootElementId )__

Clear the automatic update behavior of the element with ID ```rootElementId```.

## s.route
__void s.route ( hashUrlRegEx, { root: elementId, component: object })__
## s.addRoute
__void s.addRoute ( hashUrlRegEx, { root: elementId, component: object })__

Define a hash-based route that will replace element with ID ```elementId```'s content with the specified component on route action.

Expand All @@ -102,9 +102,9 @@ s.route('user/:userId', { component: new UserProfileComponent(), root: 'divUserP
```

## s.route
__void s.route ( hashUrl )__
__void s.route ( hashUrl, params = { } )__

Navigate to the hash-based route according to a previously defined route.
Navigate to the hash-based route according to a previously defined route. May specify route parameters as an object.

Example route call:

Expand All @@ -128,6 +128,11 @@ Example:
console.log(s.getRouteSegments()); // [ 'user', '5' ]
```

## s.getRouteParams
__object s.getRouteParams()__

Returns the current route's parameters as an object. Returns ```{ }``` if there are none.

## s.version
__number s.version ( )__

Expand Down
4 changes: 2 additions & 2 deletions docs/api-xhr.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ Create a XML HTTP Request (XHR) for the specified URL using the specified method
|Request Option |Default |Detail |
|------------------|-----------------------|--------------------------------------------|
|contentType |```application/json``` |Set ```Content-Type``` request header. |
|data |```''``` |Body of the request. |
|body |```''``` |Body of the request. |
|withCredentials |```false``` |Send cookies to 3rd party domains. |
|timeout |```0``` (No timeout) |0 is no timeout. Specified in milliseconds. |
|timeout |```0``` |0 is no timeout. Specified in milliseconds. |
|headers |```{}``` |Key/value request headers to set. |

On success, returns XMLHttpRequest which has data in ```response``` property like so:
Expand Down

0 comments on commit e564cb2

Please sign in to comment.