{# Macros #}
{%- macro addTag(name, attributes) %}
  <{$ name $}
    {%- for attrName, attrValue in attributes -%}
      {$ ' ' + attrName $}="{$ attrValue $}"
    {%- endfor -%}
    ></{$ name $}>
{%- endmacro -%}

<!doctype html>
<html lang="en" ng-app="docsApp" ng-strict-di ng-controller="DocsController">
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="Description"
        content="AngularJS is what HTML would have been, had it been designed for building web-apps.
                 Declarative templates with data-binding, MVC, dependency injection and great
                 testability story all implemented with pure client-side JavaScript!">
  <meta name="fragment" content="!">
  <title ng-bind-template="AngularJS: {{ currentArea.name }}: {{ currentPage.name || 'Error: Page not found'}}">AngularJS</title>

  <script type="text/javascript">
    (function() {
      // Dynamically, pre-emptively, add `noindex`, which will be removed when the doc is ready and valid
      ['googlebot', 'robots'].forEach(function(bot) {
        var tag = document.createElement('meta');
        tag.name = bot;
        tag.content = 'noindex';
        tag.setAttribute('ng-if', 'hasError()');
        document.head.appendChild(tag);
      });
    })();
  </script>
  <script type="text/javascript">
    // Dynamically add `<base>` tag.
    (function() {
      var indexFile = (location.pathname.match(/\/(index[^.]*\.html)/) || ['', ''])[1],
          rUrl = /(#!\/|api|guide|misc|tutorial|error|index[^.]*\.html).*$/,
          baseUrl = location.href.replace(rUrl, indexFile),
          headEl = document.getElementsByTagName('head')[0],
          baseEl = document.createElement('base');

      baseEl.setAttribute('href', baseUrl);
      headEl.appendChild(baseEl);
    })();
  </script>

  {% for stylesheet in doc.stylesheets %}
    {$- addTag('link', {rel: 'stylesheet', href: stylesheet, type: 'text/css'}) -$}
  {% endfor %}
  {% for script in doc.scripts %}
    {$- addTag('script', {src: script}) -$}
  {% endfor %}

  <script type="text/javascript">
    // GA asynchronous tracker
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-8594346-3']);
    _gaq.push(['_setDomainName', '.angularjs.org']);

    (function() {
      var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
      ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
      var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();
  </script>
</head>
<body class="homepage">
  <div id="wrapper">
    <header class="header">
      <nav id="navbar-main" class="navbar navbar-fixed-top">
        <div class="navbar-inner" ng-controller="DocsSearchCtrl">
          <div class="container">
            <h1 class="brand"><a href="http://angularjs.org"><img width="117" height="30" src="img/angularjs-for-header-only.svg" alt="AngularJS"></a></h1>

            <form class="navbar-search" ng-submit="submit()">
              <i class="glyphicon glyphicon-search search-icon"></i>
              <input type="text" name="as_q" class="search-query" placeholder="SEARCH"
                 ng-focus="focus=true"
                 ng-blur="focus=false"
                 ng-change="search(q)"
                 ng-model="q"
                 ng-model-options="{debounce: 150}"
                 docs-search-input
                 autocomplete="off">
            </form>

            <ul class="nav navbar-nav">
              <li class="dropdown" uib-dropdown>
                <a href="#" class="dropdown-toggle" uib-dropdown-toggle>Learn</a>
                <ul class="dropdown-menu" uib-dropdown-menu>
                  <li><a href="tutorial">Tutorial</a></li>
                  <li><a href="misc/faq">FAQ</a></li>
                  <li><a href="https://www.youtube.com/user/angularjs">Videos</a></li>
                  <li><a href="http://angular.codeschool.com/">Free Course</a></li>
                  <li><a href="https://www.madewithangular.com/">Case Studies</a></li>
                </ul>
              </li>
              <li class="dropdown" uib-dropdown>
                <a href="#" class="dropdown-toggle" uib-dropdown-toggle>Develop</a>
                <ul class="dropdown-menu" uib-dropdown-menu>
                  <li><a href="guide">Developer Guide</a></li>
                  <li><a href="api">API Reference</a></li>
                  <li><a href="error">Error Reference</a></li>
                  <li><a href="misc/contribute">Contribute</a></li>
                  <li><a href="https://github.com/angular/angular-seed">Seed App project template</a></li>
                  <li><a href="https://github.com/angular/angular.js">GitHub</a></li>
                  <li><a href="https://github.com/angular/angular.js/blob/master/CHANGELOG.md">Changelog</a></li>
                  <li><a href="http://code.angularjs.org/">Download</a></li>
                </ul>
              </li>
              <li class="dropdown" uib-dropdown>
                <a href="#" class="dropdown-toggle" uib-dropdown-toggle>Discuss</a>
                <ul class="dropdown-menu" uib-dropdown-menu>
                  <li><a href="http://blog.angularjs.org">Blog</a></li>
                  <li><a href="https://twitter.com/angular">Twitter</a></li>
                  <li><a href="https://plus.google.com/110323587230527980117">Google+</a></li>
                  <li><a href="https://github.com/angular/angular.js/issues">Feature &amp; Bug Tracker</a></li>
                  <li><a href="http://groups.google.com/group/angular">Mailing List</a></li>
                  <li><a href="http://webchat.freenode.net/?channels=angularjs&uio=d4">IRC</a></li>
                  <li><a href="https://gitter.im/angular/angular.js">Gitter</a></li>
                </ul>
              </li>
            </ul>

          </div>
          <div class="search-results-container" ng-show="hasResults" ng-cloak>
            <div class="container">
              <div class="search-results-frame">
                <div ng-repeat="(key, value) in results track by key" class="search-results-group" ng-class="colClassName + ' col-group-' + key" ng-show="value.length > 0">
                  <h4 class="search-results-group-heading">{{ key }}</h4>
                  <ul class="search-results">
                    <li ng-repeat="item in value" class="search-result"><a ng-click="handleResultClicked($event)" ng-href="{{ item.path }}">{{ item.name }}</a></li>
                  </ul>
                </div>
              </div>
              <a href="" ng-click="hideResults()" class="search-close">
                <span class="glyphicon glyphicon-remove search-close-icon"></span> Close
              </a>
            </div>
          </div>
        </div>
      </nav>
      <nav id="navbar-sub" class="sup-header navbar navbar-fixed-top" scroll-y-offset-element ng-cloak>
        <div class="container main-grid main-header-grid">
        <p class="site-notice">
              AngularJS support has officially ended as of January 2022.
              <a href="https://docs.angularjs.org/misc/version-support-status">
                See what ending support means
              </a> and
              <a href="https://goo.gle/angularjs-end-of-life">
                read the end of life announcement</a>.<br>
              Visit <a href="https://angular.io">angular.io</a> for the actively supported
              Angular.
            </p>
          <div class="grid-left">
            <version-picker></version-picker>
          </div>
          <div class="grid-right">
            <ul class="nav-breadcrumb">
              <li ng-repeat="crumb in breadcrumb" class="nav-breadcrumb-entry naked-list">
                <span class="divider"> /</span>
                <a ng-href="{{crumb.url}}">{{crumb.name}}</a>
              </li>
            </ul>
          </div>
        </div>
      </nav>
    </header>

    <section role="main" class="container main-body" ng-cloak>
      <div class="main-grid main-body-grid">
        <div class="grid-left">
          <a class="btn toc-toggle visible-xs" ng-click="toc=!toc">Show / Hide Table of Contents</a>
          <div class="side-navigation" ng-show="toc==true">
            <ul class="nav-list naked-list">
              <li ng-repeat="navGroup in currentArea.navGroups track by navGroup.name" class="nav-index-group">
                <a href="{{ navGroup.href }}" ng-class="navClass(navGroup)" class="nav-index-group-heading">{{ navGroup.name }}</a>
                <ul class="aside-nav">
                  <li ng-repeat="navItem in navGroup.navItems" ng-class="navClass(navItem)" class="nav-index-listing">
                    <a ng-if="navItem.extra.href" ng-class="navClass(navItem.extra)" href="{{navItem.extra.href}}">
                      {{navItem.extra.text}}<i ng-if="navItem.extra.icon" class="icon-{{navItem.extra.icon}}"></i>
                    </a>
                    <a tabindex="2" ng-class="linkClass(navItem)" href="{{navItem.href}}">{{navItem.name}}</a>
                  </li>
                </ul>
              </li>
            </ul>
            <a href="" ng-click="toc=false" class="toc-close visible-xs">
              <span class="glyphicon glyphicon-remove toc-close-icon"></span> Close
            </a>
          </div>
        </div>
        <div class="grid-right">
          <div ng-show="loading">Loading &hellip;</div>
          <div ng-show="loadingError">There was an error loading this resource. Please try again later.</div>
          <div ng-hide="loading" ng-include="partialPath" toc-collector autoscroll></div>
        </div>
      </div>
    </section>

    <footer class="footer">
      <div class="container">
        <p class="pull-right"><a back-to-top>Back to top</a></p>

        <p>
          Super-powered by Google ©2010-2020
          (<a id="version"
               ng-href="https://github.com/angular/angular.js/blob/master/CHANGELOG.md#{{versionNumber}}"
               ng-bind-template="v{{version}}" title="Changelog of this version of AngularJS">
           </a>)
        </p>
        <p>
          Code licensed under
          <a href="https://github.com/angular/angular.js/blob/master/LICENSE" target="_blank">The MIT License</a>.
          Documentation licensed under
          <a href="http://creativecommons.org/licenses/by/3.0/" target="_blank">CC BY 3.0</a>.
        </p>
      </div>
    </footer>
  </div>
</body>
</html>
