//This class is exported directly as module. To import it import UrlPathAdapter= require("ojs/ojurlpathadapter");
Generic Parameters
Parameter
Description
P
Parameters object for the router state
JET In Typescript
A detailed description of working with JET elements and classes in your typescript project can be found at:
JET Typescript Usage.
Description
UrlPathAdapter class
A URL adapter that uses path segments to synchronize router state
(/path1/path2/path3). This adapter is the default for CoreRouter,
and should be used when the web server serving up UI content has the ability
to internally proxy requests from one pseudo path to another.
For instance,
if the root of your application is http://localhost/, then
router states will be added onto this root using path segments, such as
http://localhost/path1/path. This path may be bookmarked, and
during restoration (or browser reload), the server will be asked to serve
up the content from that directory. Since these are presumably virtual
directories (they may or may not actually exist on the server), two things
must happen for the UI to load correctly:
The web server must recognize that "/path1/path2" are virtual paths
and serve up the content from the root (/) instead.
baseUrl must be set to the correct root;
in this case--"http://localhost/"
The base URL from which the application is served.
This value may be any string value (even blank). If not specified at all
(undefined), then the adapter will use document.location.pathname as its
base.
Build all routes for the given URL. The URL is expected to start with the
baseUrl set for this adapter, because it will be subtracted
out before routes are built.
Parameters:
Name
Type
Argument
Description
url
string
<optional>
Optional URL to use. If not specified, document.location.pathname
is used.
Returns:
An array of routes starting from the path
for the given router.