<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Routing on AngularTS</title><link>https://angular-wave.github.io/angular.ts/docs/routing/</link><description>Recent content in Routing on AngularTS</description><generator>Hugo</generator><language>en</language><atom:link href="https://angular-wave.github.io/angular.ts/docs/routing/index.xml" rel="self" type="application/rss+xml"/><item><title>State-based routing in AngularTS applications</title><link>https://angular-wave.github.io/angular.ts/docs/routing/overview/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://angular-wave.github.io/angular.ts/docs/routing/overview/</guid><description>&lt;p>AngularTS ships a full-featured router ported from UI-Router. Unlike simple URL-based routers, it models your application as a &lt;strong>state machine&lt;/strong>: each screen or workflow step is a named state, and navigation means transitioning from one state to another. URLs are one way to enter a state, but they are not the primary concept—states are.&lt;/p>
&lt;h2 id="key-concepts">Key concepts&lt;a class="td-heading-self-link" href="#key-concepts" aria-label="Heading self-link">&lt;/a>&lt;/h2>
&lt;p>The router is built from five interlocking primitives:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>States&lt;/strong> — named nodes in the application state tree. Each state can have a URL, template, controller, and resolved data.&lt;/li>
&lt;li>&lt;strong>Views&lt;/strong> — the rendered output of a state, inserted into a &lt;code>ng-view&lt;/code> element in the DOM.&lt;/li>
&lt;li>&lt;strong>Resolves&lt;/strong> — asynchronous data-fetching functions that run before a state is entered.&lt;/li>
&lt;li>&lt;strong>Transitions&lt;/strong> — the lifecycle of moving from one state (or set of states) to another, with hooks you can intercept.&lt;/li>
&lt;li>&lt;strong>URL matching&lt;/strong> — an optional layer that maps browser URLs onto states and keeps them in sync.&lt;/li>
&lt;/ul>
&lt;h2 id="how-routing-integrates-with-the-module-system">How routing integrates with the module system&lt;a class="td-heading-self-link" href="#how-routing-integrates-with-the-module-system" aria-label="Heading self-link">&lt;/a>&lt;/h2>
&lt;p>The router exposes three injectable services that cover the full routing API:&lt;/p></description></item><item><title>States</title><link>https://angular-wave.github.io/angular.ts/docs/routing/states/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://angular-wave.github.io/angular.ts/docs/routing/states/</guid><description>&lt;p>A state represents a place in an AngularTS application: a page, a nested layout,
a modal, or a step in a workflow. States are declared as plain objects and
registered through &lt;code>$stateProvider&lt;/code> during configuration or &lt;code>$stateRegistry&lt;/code> at
runtime.&lt;/p>
&lt;p>Exact state and router contracts live in TypeDoc:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="../../../typedoc/interfaces/StateDeclaration.html">&lt;code>StateDeclaration&lt;/code>&lt;/a>&lt;/li>
&lt;li>&lt;a href="../../../typedoc/classes/StateProvider.html">&lt;code>StateProvider&lt;/code>&lt;/a>&lt;/li>
&lt;li>&lt;a href="../../../typedoc/classes/StateRegistryProvider.html">&lt;code>StateRegistryProvider&lt;/code>&lt;/a>&lt;/li>
&lt;li>&lt;a href="../../../typedoc/interfaces/TransitionOptions.html">&lt;code>TransitionOptions&lt;/code>&lt;/a>&lt;/li>
&lt;li>&lt;a href="../../../typedoc/interfaces/TransitionPromise.html">&lt;code>TransitionPromise&lt;/code>&lt;/a>&lt;/li>
&lt;li>&lt;a href="../../../typedoc/types/StateResolveObject.html">&lt;code>StateResolveObject&lt;/code>&lt;/a>&lt;/li>
&lt;li>&lt;a href="../../../typedoc/types/StateResolveArray.html">&lt;code>StateResolveArray&lt;/code>&lt;/a>&lt;/li>
&lt;li>&lt;a href="../../../typedoc/interfaces/ParamDeclaration.html">&lt;code>ParamDeclaration&lt;/code>&lt;/a>&lt;/li>
&lt;li>&lt;a href="../../../typedoc/interfaces/HrefOptions.html">&lt;code>HrefOptions&lt;/code>&lt;/a>&lt;/li>
&lt;/ul>
&lt;h2 id="register-states">Register States&lt;a class="td-heading-self-link" href="#register-states" aria-label="Heading self-link">&lt;/a>&lt;/h2>
&lt;p>Register most states in a config block, or use &lt;code>module.state()&lt;/code> for the same
provider registration through the fluent module API. Calls to both
&lt;code>$stateProvider.state()&lt;/code> and &lt;code>module.state()&lt;/code> are chainable.&lt;/p></description></item><item><title>Routing transitions and lifecycle hooks</title><link>https://angular-wave.github.io/angular.ts/docs/routing/transitions/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://angular-wave.github.io/angular.ts/docs/routing/transitions/</guid><description>&lt;p>Every navigation in AngularTS is a &lt;code>Transition&lt;/code>—a structured object that describes moving from one state (or set of states) to another. Transitions carry the from-state, the to-state, all parameter values, the tree of entering/exiting/retained states, and the resolve context. You hook into their lifecycle to implement auth guards, loading indicators, analytics, scroll resets, and more.&lt;/p>
&lt;h2 id="what-is-a-transition">What is a transition&lt;a class="td-heading-self-link" href="#what-is-a-transition" aria-label="Heading self-link">&lt;/a>&lt;/h2>
&lt;p>When you call &lt;code>$state.go('contacts.detail', { contactId: 42 })&lt;/code>, the router creates a &lt;code>Transition&lt;/code> instance. Internally it computes a &lt;code>TreeChanges&lt;/code> object with five paths:&lt;/p></description></item><item><title>URL matching and configuration in AngularTS router</title><link>https://angular-wave.github.io/angular.ts/docs/routing/url-matching/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://angular-wave.github.io/angular.ts/docs/routing/url-matching/</guid><description>&lt;p>The AngularTS router matches the browser&amp;rsquo;s URL against registered state declarations and activates the best matching state. URL matching is an optional layer on top of the state machine—states can be navigated to programmatically without any URL involvement—but most applications use URLs to make deep-linking and browser history work correctly.&lt;/p>
&lt;h2 id="how-url-matching-works">How URL matching works&lt;a class="td-heading-self-link" href="#how-url-matching-works" aria-label="Heading self-link">&lt;/a>&lt;/h2>
&lt;p>When the browser URL changes (or on initial load), the &lt;code>UrlService&lt;/code> calls &lt;code>sync()&lt;/code>. It iterates all registered URL rules in priority order and finds the best match using a weighted scoring system. The winning rule&amp;rsquo;s handler is called, which calls &lt;code>$state.go()&lt;/code> with the matched state and extracted parameter values.&lt;/p></description></item></channel></rss>