Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
831 lines (830 sloc) 44.1 KB
---
---
<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>UrlConfigApi | ui-router-ng2</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
<link rel="stylesheet" href="../assets/css/uirouter.css">
<script src="../assets/js/modernizr.js"></script>
<script src="../assets/js/reset.js"></script>
</head>
<body>
<header>
<div class="tsd-page-toolbar">
<div class="container">
<div class="table-wrap">
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base="..">
<div class="field">
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
<input id="tsd-search-field" type="text" />
</div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="../index.html" class="title">ui-router-ng2</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
<div class="tsd-filter-group">
<!--
<div class="tsd-select" id="tsd-filter-visibility">
<span class="tsd-select-label">All</span>
<ul class="tsd-select-list">
<li data-value="public">Public</li>
<li data-value="protected">Public/Protected</li>
<li data-value="private" class="selected">All</li>
</ul>
</div>
<input type="checkbox" id="tsd-filter-inherited" checked />
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
-->
<input type="checkbox" id="tsd-filter-externals" checked />
<label class="tsd-widget" for="tsd-filter-externals">Internal UI-Router API</label>
<!--
<input type="checkbox" id="tsd-filter-only-exported" />
<label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label>
-->
</div>
</div>
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
</div>
</div>
</div>
</div>
<div class="tsd-page-title">
<div class="container">
<ul class="tsd-breadcrumb">
<li>
<a href="../index.html">ui-router-ng2</a>
</li>
<li>
<a href="../modules/url.html">url</a>
</li>
<li>
<a href="url.urlconfigapi.html">UrlConfigApi</a>
</li>
</ul>
<h1>Interface UrlConfigApi</h1>
</div>
</div>
</header>
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>An API to customize the URL behavior and retrieve URL configuration</p>
</div>
<p>This API can customize the behavior of the URL.
This includes optional trailing slashes (<a href="url.urlconfigapi.html#strictmode">strictMode</a>), case sensitivity (<a href="url.urlconfigapi.html#caseinsensitive">caseInsensitive</a>),
and custom parameter encoding (custom <a href="url.urlconfigapi.html#type">type</a>).</p>
<p>It also has information about the location (url) configuration such as <a href="url.urlconfigapi.html#port">port</a> and <a href="url.urlconfigapi.html#basehref">baseHref</a>.
This information can be used to build absolute URLs, such as
<code>https://example.com:443/basepath/state/substate?param1=a#hashvalue</code>;</p>
<p>This API is found on <a href="../classes/url.urlservice.html#config">UrlService.config</a>.</p>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<a href="common.locationconfig.html" class="tsd-signature-type">LocationConfig</a>
</li>
<li>
<a href="url.urlmatcherconfig.html" class="tsd-signature-type">UrlMatcherConfig</a>
<ul class="tsd-hierarchy">
<li>
<span class="target">UrlConfigApi</span>
</li>
</ul>
</li>
</ul>
</section>
<section class="tsd-panel-group tsd-index-group">
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section tsd-is-inherited">
<h3>Methods</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="url.urlconfigapi.html#basehref" class="tsd-kind-icon">base<wbr>Href</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="url.urlconfigapi.html#caseinsensitive" class="tsd-kind-icon">case<wbr>Insensitive</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="url.urlconfigapi.html#defaultsquashpolicy" class="tsd-kind-icon">default<wbr>Squash<wbr>Policy</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="url.urlconfigapi.html#dispose" class="tsd-kind-icon">dispose</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="url.urlconfigapi.html#hashprefix" class="tsd-kind-icon">hash<wbr>Prefix</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="url.urlconfigapi.html#host" class="tsd-kind-icon">host</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="url.urlconfigapi.html#html5mode" class="tsd-kind-icon">html5<wbr>Mode</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="url.urlconfigapi.html#port" class="tsd-kind-icon">port</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="url.urlconfigapi.html#protocol" class="tsd-kind-icon">protocol</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="url.urlconfigapi.html#strictmode" class="tsd-kind-icon">strict<wbr>Mode</a></li>
<li class="tsd-kind-method tsd-parent-kind-interface tsd-is-inherited"><a href="url.urlconfigapi.html#type" class="tsd-kind-icon">type</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group tsd-is-inherited">
<h2>Methods</h2>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<a name="basehref" class="tsd-anchor"></a>
<!--
<h3>base<wbr>Href</h3>
-->
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<li class="tsd-signature tsd-kind-icon">base<wbr>Href<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
<li class="tsd-header">
<p> Gets the base Href, e.g., <code>http://localhost/approot</code> </p>
</li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Gets the base Href, e.g., <code>http://localhost/approot</code></p>
</div>
</div>
<div class="tsd-returns">
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
: <p>the application&#39;s base href</p>
</div>
<hr>
<aside class="tsd-sources">
<p>Inherited from <a href="common.locationconfig.html">LocationConfig</a>.<a href="common.locationconfig.html#basehref">baseHref</a></p>
<ul>
<li>Defined in <a href="https://github.com/ui-router/core/blob/fec3bb1/src/common/coreservices.ts#L151">ui-router-core/src/common/coreservices.ts:151</a></li>
</ul>
</aside> </li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<a name="caseinsensitive" class="tsd-anchor"></a>
<!--
<h3>case<wbr>Insensitive</h3>
-->
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<li class="tsd-signature tsd-kind-icon">case<wbr>Insensitive<span class="tsd-signature-symbol">(</span>value<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
<li class="tsd-header">
<p> Defines whether URL matching should be case sensitive (the default behavior), or not. </p>
</li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Defines whether URL matching should be case sensitive (the default behavior), or not.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>value: <span class="tsd-flag ts-flagOptional">Optional</span>&nbsp; <span class="tsd-signature-type">boolean</span></h5>
: <div class="tsd-comment tsd-typography">
<p><code>false</code> to match URL in a case sensitive manner; otherwise <code>true</code>;</p>
</div>
</li>
</ul>
<div class="tsd-returns">
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
: <p>the current value of caseInsensitive</p>
<h4 id="example-">Example:</h4>
<pre><code class="lang-js"><span class="hljs-comment">// Allow case insensitive url matches</span>
urlService.config.caseInsensitive(<span class="hljs-literal">true</span>);
</code></pre>
</div>
<hr>
<aside class="tsd-sources">
<p>Inherited from <a href="url.urlmatcherconfig.html">UrlMatcherConfig</a>.<a href="url.urlmatcherconfig.html#caseinsensitive">caseInsensitive</a></p>
<ul>
<li>Defined in <a href="https://github.com/ui-router/core/blob/fec3bb1/src/url/interface.ts#L61">ui-router-core/src/url/interface.ts:61</a></li>
</ul>
</aside> </li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<a name="defaultsquashpolicy" class="tsd-anchor"></a>
<!--
<h3>default<wbr>Squash<wbr>Policy</h3>
-->
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<li class="tsd-signature tsd-kind-icon">default<wbr>Squash<wbr>Policy<span class="tsd-signature-symbol">(</span>value<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">true</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">false</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">true</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">false</span></li>
<li class="tsd-header">
<p> Sets the default behavior when generating or matching URLs with default parameter values. </p>
</li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Sets the default behavior when generating or matching URLs with default parameter values.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>value: <span class="tsd-flag ts-flagOptional">Optional</span>&nbsp; <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">true</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">false</span></h5>
: <div class="tsd-comment tsd-typography">
<p>A string that defines the default parameter URL squashing behavior.</p>
<ul>
<li><code>nosquash</code>: When generating an href with a default parameter value, do not squash the parameter value from the URL</li>
<li><code>slash</code>: When generating an href with a default parameter value, squash (remove) the parameter value, and, if the
parameter is surrounded by slashes, squash (remove) one slash from the URL</li>
<li>any other string, e.g. &quot;~&quot;: When generating an href with a default parameter value, squash (remove)
the parameter value from the URL and replace it with this string.</li>
</ul>
</div>
</li>
</ul>
<div class="tsd-returns">
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span>
<span class="tsd-signature-symbol"> | </span>
<span class="tsd-signature-type">true</span>
<span class="tsd-signature-symbol"> | </span>
<span class="tsd-signature-type">false</span>
</h4>
: <p>the current value of defaultSquashPolicy</p>
<h4 id="example-">Example:</h4>
<pre><code class="lang-js"><span class="hljs-comment">// Remove default parameter values from the url</span>
urlService.config.defaultSquashPolicy(<span class="hljs-literal">true</span>);
</code></pre>
</div>
<hr>
<aside class="tsd-sources">
<p>Inherited from <a href="url.urlmatcherconfig.html">UrlMatcherConfig</a>.<a href="url.urlmatcherconfig.html#defaultsquashpolicy">defaultSquashPolicy</a></p>
<ul>
<li>Defined in <a href="https://github.com/ui-router/core/blob/fec3bb1/src/url/interface.ts#L94">ui-router-core/src/url/interface.ts:94</a></li>
</ul>
</aside> </li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<a name="dispose" class="tsd-anchor"></a>
<!--
<h3>dispose</h3>
-->
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<li class="tsd-signature tsd-kind-icon">dispose<span class="tsd-signature-symbol">(</span>router<span class="tsd-signature-symbol">?: </span><a href="../classes/core.uirouter.html" class="tsd-signature-type">UIRouter</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></li>
<li class="tsd-header">
<p> Instructs the Disposable to clean up any resources </p>
</li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Instructs the Disposable to clean up any resources</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>router: <span class="tsd-flag ts-flagOptional">Optional</span>&nbsp; <a href="../classes/core.uirouter.html" class="tsd-signature-type">UIRouter</a></h5>
</li>
</ul>
<div class="tsd-returns">
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4>
</div>
<hr>
<aside class="tsd-sources">
<p>Inherited from <a href="core.disposable.html">Disposable</a>.<a href="core.disposable.html#dispose">dispose</a></p>
<ul>
<li>Defined in <a href="https://github.com/ui-router/core/blob/fec3bb1/src/interface.ts#L123">ui-router-core/src/interface.ts:123</a></li>
</ul>
</aside> </li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<a name="hashprefix" class="tsd-anchor"></a>
<!--
<h3>hash<wbr>Prefix</h3>
-->
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<li class="tsd-signature tsd-kind-icon">hash<wbr>Prefix<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
<li class="tsd-header">
<p> Gets the hashPrefix (when not running in pushstate mode) </p>
</li>
<li class="tsd-signature tsd-kind-icon">hash<wbr>Prefix<span class="tsd-signature-symbol">(</span>newprefix<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
<li class="tsd-header">
<p> Sets the hashPrefix (when not running in pushstate mode) </p>
</li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Gets the hashPrefix (when not running in pushstate mode)</p>
</div>
<p>If the current url is <code>http://localhost/app#!/uirouter/path/#anchor</code>, it returns <code>!</code> which is the prefix for the &quot;hashbang&quot; portion.</p>
</div>
<div class="tsd-returns">
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
: <p>the hash prefix</p>
</div>
<hr>
<aside class="tsd-sources">
<p>Inherited from <a href="common.locationconfig.html">LocationConfig</a>.<a href="common.locationconfig.html#hashprefix">hashPrefix</a></p>
<ul>
<li>Defined in <a href="https://github.com/ui-router/core/blob/fec3bb1/src/common/coreservices.ts#L165">ui-router-core/src/common/coreservices.ts:165</a></li>
</ul>
</aside> </li>
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Sets the hashPrefix (when not running in pushstate mode)</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>newprefix <span class="tsd-signature-type">string</span></h5>
</li>
</ul>
<div class="tsd-returns">
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
: <p>the new hash prefix</p>
</div>
<hr>
<aside class="tsd-sources">
<p>Inherited from <a href="common.locationconfig.html">LocationConfig</a>.<a href="common.locationconfig.html#hashprefix">hashPrefix</a></p>
<ul>
<li>Defined in <a href="https://github.com/ui-router/core/blob/fec3bb1/src/common/coreservices.ts#L171">ui-router-core/src/common/coreservices.ts:171</a></li>
</ul>
</aside> </li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<a name="host" class="tsd-anchor"></a>
<!--
<h3>host</h3>
-->
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<li class="tsd-signature tsd-kind-icon">host<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
<li class="tsd-header">
<p> Gets the host, e.g., <code>localhost</code> </p>
</li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Gets the host, e.g., <code>localhost</code></p>
</div>
</div>
<div class="tsd-returns">
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
: <p>the protocol</p>
</div>
<hr>
<aside class="tsd-sources">
<p>Inherited from <a href="common.locationconfig.html">LocationConfig</a>.<a href="common.locationconfig.html#host">host</a></p>
<ul>
<li>Defined in <a href="https://github.com/ui-router/core/blob/fec3bb1/src/common/coreservices.ts#L145">ui-router-core/src/common/coreservices.ts:145</a></li>
</ul>
</aside> </li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<a name="html5mode" class="tsd-anchor"></a>
<!--
<h3>html5<wbr>Mode</h3>
-->
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<li class="tsd-signature tsd-kind-icon">html5<wbr>Mode<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
<li class="tsd-header">
<p> Returns true when running in pushstate mode </p>
</li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Returns true when running in pushstate mode</p>
</div>
</div>
<div class="tsd-returns">
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
: <p>true when running in pushstate mode</p>
</div>
<hr>
<aside class="tsd-sources">
<p>Inherited from <a href="common.locationconfig.html">LocationConfig</a>.<a href="common.locationconfig.html#html5mode">html5Mode</a></p>
<ul>
<li>Defined in <a href="https://github.com/ui-router/core/blob/fec3bb1/src/common/coreservices.ts#L157">ui-router-core/src/common/coreservices.ts:157</a></li>
</ul>
</aside> </li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<a name="port" class="tsd-anchor"></a>
<!--
<h3>port</h3>
-->
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<li class="tsd-signature tsd-kind-icon">port<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li>
<li class="tsd-header">
<p> Gets the port, e.g., <code>80</code> </p>
</li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Gets the port, e.g., <code>80</code></p>
</div>
</div>
<div class="tsd-returns">
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4>
: <p>the port number</p>
</div>
<hr>
<aside class="tsd-sources">
<p>Inherited from <a href="common.locationconfig.html">LocationConfig</a>.<a href="common.locationconfig.html#port">port</a></p>
<ul>
<li>Defined in <a href="https://github.com/ui-router/core/blob/fec3bb1/src/common/coreservices.ts#L133">ui-router-core/src/common/coreservices.ts:133</a></li>
</ul>
</aside> </li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<a name="protocol" class="tsd-anchor"></a>
<!--
<h3>protocol</h3>
-->
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<li class="tsd-signature tsd-kind-icon">protocol<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
<li class="tsd-header">
<p> Gets the protocol, e.g., <code>http</code> </p>
</li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Gets the protocol, e.g., <code>http</code></p>
</div>
</div>
<div class="tsd-returns">
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
: <p>the protocol</p>
</div>
<hr>
<aside class="tsd-sources">
<p>Inherited from <a href="common.locationconfig.html">LocationConfig</a>.<a href="common.locationconfig.html#protocol">protocol</a></p>
<ul>
<li>Defined in <a href="https://github.com/ui-router/core/blob/fec3bb1/src/common/coreservices.ts#L139">ui-router-core/src/common/coreservices.ts:139</a></li>
</ul>
</aside> </li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<a name="strictmode" class="tsd-anchor"></a>
<!--
<h3>strict<wbr>Mode</h3>
-->
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<li class="tsd-signature tsd-kind-icon">strict<wbr>Mode<span class="tsd-signature-symbol">(</span>value<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
<li class="tsd-header">
<p> Defines whether URLs should match trailing slashes, or not (the default behavior). </p>
</li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Defines whether URLs should match trailing slashes, or not (the default behavior).</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>value: <span class="tsd-flag ts-flagOptional">Optional</span>&nbsp; <span class="tsd-signature-type">boolean</span></h5>
: <div class="tsd-comment tsd-typography">
<p><code>false</code> to match trailing slashes in URLs, otherwise <code>true</code>.</p>
</div>
</li>
</ul>
<div class="tsd-returns">
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
: <p>the current value of strictMode</p>
<h4 id="example-">Example:</h4>
<pre><code class="lang-js"><span class="hljs-comment">// Allow optional trailing slashes</span>
urlService.config.strictMode(<span class="hljs-literal">false</span>);
</code></pre>
</div>
<hr>
<aside class="tsd-sources">
<p>Inherited from <a href="url.urlmatcherconfig.html">UrlMatcherConfig</a>.<a href="url.urlmatcherconfig.html#strictmode">strictMode</a></p>
<ul>
<li>Defined in <a href="https://github.com/ui-router/core/blob/fec3bb1/src/url/interface.ts#L75">ui-router-core/src/url/interface.ts:75</a></li>
</ul>
</aside> </li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<a name="type" class="tsd-anchor"></a>
<!--
<h3>type</h3>
-->
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<li class="tsd-signature tsd-kind-icon">type<span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, type<span class="tsd-signature-symbol">?: </span><a href="params.paramtypedefinition.html" class="tsd-signature-type">ParamTypeDefinition</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../classes/params.paramtype.html" class="tsd-signature-type">ParamType</a></li>
<li class="tsd-header">
<p> Creates and registers a custom <a href="params.paramtypedefinition.html">ParamTypeDefinition</a> object </p>
</li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Creates and registers a custom <a href="params.paramtypedefinition.html">ParamTypeDefinition</a> object</p>
</div>
<p>A custom parameter type can be used to generate URLs with typed parameters or custom encoding/decoding.</p>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>name <span class="tsd-signature-type">string</span></h5>
: <div class="tsd-comment tsd-typography">
<p>The type name.</p>
</div>
</li>
<li>
<h5>type: <span class="tsd-flag ts-flagOptional">Optional</span>&nbsp; <a href="params.paramtypedefinition.html" class="tsd-signature-type">ParamTypeDefinition</a></h5>
: <div class="tsd-comment tsd-typography">
<p>The type definition. See <a href="params.paramtypedefinition.html">ParamTypeDefinition</a> for examples and information.</p>
</div>
</li>
</ul>
<div class="tsd-returns">
<h4 class="tsd-returns-title">Returns <a href="../classes/params.paramtype.html" class="tsd-signature-type">ParamType</a></h4>
: <p>if only the <code>name</code> parameter was specified: the currently registered <a href="../classes/params.paramtype.html">ParamType</a> object, or undefined</p>
<h4 id="note-register-custom-types-before-using-them-in-a-state-definition-">Note: Register custom types <em>before using them</em> in a state definition.</h4>
<h4 id="example-">Example:</h4>
<pre><code class="lang-js"><span class="hljs-comment">// Encode object parameter as JSON string</span>
urlService.config.type(<span class="hljs-string">'myjson'</span>, {
<span class="hljs-attr">encode</span>: <span class="hljs-function">(<span class="hljs-params">obj</span>) =&gt;</span> <span class="hljs-built_in">JSON</span>.stringify(obj),
<span class="hljs-attr">decode</span>: <span class="hljs-function">(<span class="hljs-params">str</span>) =&gt;</span> <span class="hljs-built_in">JSON</span>.parse(str),
<span class="hljs-attr">is</span>: <span class="hljs-function">(<span class="hljs-params">val</span>) =&gt;</span> <span class="hljs-keyword">typeof</span>(val) === <span class="hljs-string">'object'</span>,
<span class="hljs-attr">pattern</span>: <span class="hljs-regexp">/[^/]+/</span>,
<span class="hljs-attr">equals</span>: <span class="hljs-function">(<span class="hljs-params">a, b</span>) =&gt;</span> _.isEqual(a, b),
});
</code></pre>
</div>
<hr>
<aside class="tsd-sources">
<p>Inherited from <a href="url.urlmatcherconfig.html">UrlMatcherConfig</a>.<a href="url.urlmatcherconfig.html#type">type</a></p>
<ul>
<li>Defined in <a href="https://github.com/ui-router/core/blob/fec3bb1/src/url/interface.ts#L120">ui-router-core/src/url/interface.ts:120</a></li>
</ul>
</aside> </li>
</ul>
</section>
</section>
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<nav class="tsd-navigation primary">
<ul>
<li class="globals ">
<a href="../index.html"><em>ui-<wbr>router-<wbr>ng2</em></a>
</li>
<li class="label tsd-is-external">
<span>Public API</span>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/core.html">core</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/directives.html">directives</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/params.html">params</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/resolve.html">resolve</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/state.html">state</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/trace.html">trace</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/transition.html">transition</a>
</li>
<li class="current tsd-kind-external-module">
<a href="../modules/url.html">url</a>
</li>
<li class="label tsd-is-external">
<span>Internal UI-<wbr><wbr>Router API</span>
</li>
<li class=" tsd-kind-external-module tsd-is-external">
<a href="../modules/common.html">common</a>
</li>
<li class=" tsd-kind-external-module tsd-is-external">
<a href="../modules/common_hof.html">common_<wbr>hof</a>
</li>
<li class=" tsd-kind-external-module tsd-is-external">
<a href="../modules/common_predicates.html">common_<wbr>predicates</a>
</li>
<li class=" tsd-kind-external-module tsd-is-external">
<a href="../modules/common_strings.html">common_<wbr>strings</a>
</li>
<li class=" tsd-kind-external-module tsd-is-external">
<a href="../modules/hooks.html">hooks</a>
</li>
<li class=" tsd-kind-external-module tsd-is-external">
<a href="../modules/ng2.html">ng2</a>
</li>
<li class=" tsd-kind-external-module tsd-is-external">
<a href="../modules/path.html">path</a>
</li>
<li class=" tsd-kind-external-module tsd-is-external">
<a href="../modules/vanilla.html">vanilla</a>
</li>
<li class=" tsd-kind-external-module tsd-is-external">
<a href="../modules/view.html">view</a>
</li>
</ul>
</nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
<li class=" tsd-kind-class tsd-parent-kind-external-module tsd-is-external">
<a href="../classes/url.baseurlrule.html" class="tsd-kind-icon">Base<wbr>Url<wbr>Rule</a>
</li>
<li class=" tsd-kind-class tsd-parent-kind-external-module">
<a href="../classes/url.urlmatcher.html" class="tsd-kind-icon">Url<wbr>Matcher</a>
</li>
<li class=" tsd-kind-class tsd-parent-kind-external-module tsd-is-external">
<a href="../classes/url.urlmatcherfactory.html" class="tsd-kind-icon">Url<wbr>Matcher<wbr>Factory</a>
</li>
<li class=" tsd-kind-class tsd-parent-kind-external-module tsd-is-external">
<a href="../classes/url.urlrouter.html" class="tsd-kind-icon">Url<wbr>Router</a>
</li>
<li class=" tsd-kind-class tsd-parent-kind-external-module tsd-is-external">
<a href="../classes/url.urlrulefactory.html" class="tsd-kind-icon">Url<wbr>Rule<wbr>Factory</a>
</li>
<li class=" tsd-kind-class tsd-parent-kind-external-module">
<a href="../classes/url.urlservice.html" class="tsd-kind-icon">Url<wbr>Service</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-external-module">
<a href="url.matchresult.html" class="tsd-kind-icon">Match<wbr>Result</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-external-module tsd-is-external">
<a href="url.matcherurlrule.html" class="tsd-kind-icon">Matcher<wbr>Url<wbr>Rule</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-external-module tsd-is-external">
<a href="url.paramfactory.html" class="tsd-kind-icon">Param<wbr>Factory</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-external-module tsd-is-external">
<a href="url.regexprule.html" class="tsd-kind-icon">Reg<wbr>Exp<wbr>Rule</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-external-module tsd-is-external">
<a href="url.staterule.html" class="tsd-kind-icon">State<wbr>Rule</a>
</li>
</ul>
<ul class="current">
<li class="current tsd-kind-interface tsd-parent-kind-external-module">
<a href="url.urlconfigapi.html" class="tsd-kind-icon">Url<wbr>Config<wbr>Api</a>
<ul>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<a href="url.urlconfigapi.html#basehref" class="tsd-kind-icon">base<wbr>Href</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<a href="url.urlconfigapi.html#caseinsensitive" class="tsd-kind-icon">case<wbr>Insensitive</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<a href="url.urlconfigapi.html#defaultsquashpolicy" class="tsd-kind-icon">default<wbr>Squash<wbr>Policy</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<a href="url.urlconfigapi.html#dispose" class="tsd-kind-icon">dispose</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<a href="url.urlconfigapi.html#hashprefix" class="tsd-kind-icon">hash<wbr>Prefix</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<a href="url.urlconfigapi.html#host" class="tsd-kind-icon">host</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<a href="url.urlconfigapi.html#html5mode" class="tsd-kind-icon">html5<wbr>Mode</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<a href="url.urlconfigapi.html#port" class="tsd-kind-icon">port</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<a href="url.urlconfigapi.html#protocol" class="tsd-kind-icon">protocol</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<a href="url.urlconfigapi.html#strictmode" class="tsd-kind-icon">strict<wbr>Mode</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-inherited">
<a href="url.urlconfigapi.html#type" class="tsd-kind-icon">type</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">
<li class=" tsd-kind-interface tsd-parent-kind-external-module">
<a href="url.urlmatcherconfig.html" class="tsd-kind-icon">Url<wbr>Matcher<wbr>Config</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-external-module">
<a href="url.urlparts.html" class="tsd-kind-icon">Url<wbr>Parts</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-external-module">
<a href="url.urlrule.html" class="tsd-kind-icon">Url<wbr>Rule</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-external-module">
<a href="url.urlrulehandlerfn.html" class="tsd-kind-icon">Url<wbr>Rule<wbr>Handler<wbr>Fn</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-external-module">
<a href="url.urlrulematchfn.html" class="tsd-kind-icon">Url<wbr>Rule<wbr>Match<wbr>Fn</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-external-module">
<a href="url.urlrulesapi.html" class="tsd-kind-icon">Url<wbr>Rules<wbr>Api</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-external-module tsd-is-external">
<a href="url.urlsyncapi.html" class="tsd-kind-icon">Url<wbr>Sync<wbr>Api</a>
</li>
<li class=" tsd-kind-type-alias tsd-parent-kind-external-module tsd-is-external">
<a href="../modules/url.html#urlruletype" class="tsd-kind-icon">Url<wbr>Rule<wbr>Type</a>
</li>
<li class=" tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported">
<a href="../modules/url.html#defaultrulesortfn" class="tsd-kind-icon">default<wbr>Rule<wbr>Sort<wbr>Fn</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<footer class="with-border-bottom">
<div class="container">
<h2>Legend</h2>
<div class="tsd-legend-group">
<ul class="tsd-legend">
<li class="tsd-kind-module"><span class="tsd-kind-icon">Module</span></li>
<li class="tsd-kind-object-literal"><span class="tsd-kind-icon">Object literal</span></li>
<li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li>
<li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li>
<li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li>
<li class="tsd-kind-index-signature"><span class="tsd-kind-icon">Index signature</span></li>
<li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li>
<li class="tsd-kind-enum-member"><span class="tsd-kind-icon">Enumeration member</span></li>
<li class="tsd-kind-property tsd-parent-kind-enum"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-enum"><span class="tsd-kind-icon">Method</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li>
<li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li>
<li class="tsd-kind-constructor tsd-parent-kind-interface"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
<li class="tsd-kind-index-signature tsd-parent-kind-interface"><span class="tsd-kind-icon">Index signature</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li>
<li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li>
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li>
<li class="tsd-kind-index-signature tsd-parent-kind-class"><span class="tsd-kind-icon">Index signature</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
<li class="tsd-kind-call-signature tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
</ul>
</div>
</div>
</footer>
<div class="container tsd-generator">
<p>Generated using <a href="http://typedoc.io" target="_blank">TypeDoc</a></p>
</div>
<div class="overlay"></div>
<script src="../assets/js/main.js"></script>
<script>if (location.protocol == 'file:') document.write('<script src="../assets/js/search.js"><' + '/script>');</script>
</body>
</html>
You can’t perform that action at this time.