<!doctypehtml><html lang=en ng-app=docsApp ng-controller=DocsController ng-strict-di><meta content=width=device-width,initial-scale=1.0 name=viewport><meta charset=utf-8><meta content=IE=edge http-equiv=X-UA-Compatible><meta 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!"name=Description><meta content=! name=fragment><title ng-bind-template="AngularJS: {{ currentArea.name }}: {{ currentPage.name || 'Error: Page not found'}}">
   AngularJS
  </title><script>(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>// 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><link href=components/bootstrap-3.1.1/css/bootstrap.min.css rel=stylesheet><link href=css/prettify-theme.css rel=stylesheet><link href=css/angular-topnav.css rel=stylesheet><link href=css/docs.css rel=stylesheet><link href=css/animations.css rel=stylesheet><script src=//ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js></script><script src=//ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular-resource.min.js></script><script src=//ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular-route.min.js></script><script src=//ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular-cookies.min.js></script><script src=//ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular-sanitize.min.js></script><script src=//ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular-touch.min.js></script><script src=//ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular-animate.min.js></script><script src=components/marked-0.3.6/marked.min.js></script><script src=js/angular-bootstrap/dropdown-toggle.min.js></script><script src=components/lunr-0.7.2/lunr.min.js></script><script src=components/google-code-prettify-1.0.1/src/prettify.js></script><script src=components/google-code-prettify-1.0.1/src/lang-css.js></script><script src=js/current-version-data.js></script><script src=https://code.angularjs.org/snapshot/docs/js/all-versions-data.js></script><script src=js/pages-data.js></script><script src=js/nav-data.js></script><script src=js/docs.min.js></script><script>// 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><body class=homepage><div id=wrapper><header class=header><nav class="navbar navbar-fixed-top"id=navbar-main><div class=navbar-inner ng-controller=DocsSearchCtrl><div class=container><h1 class=brand><a href=http://angularjs.org> <img alt=AngularJS height=30 src=img/angularjs-for-header-only.svg width=117> </a></h1><form class=navbar-search ng-submit=submit()><i class="glyphicon glyphicon-search search-icon"> </i><input ng-model-options="{debounce: 150}"autocomplete=off class=search-query docs-search-input name=as_q ng-blur=focus=false ng-change=search(q) ng-focus=focus=true ng-model=q placeholder=SEARCH></form><ul class="nav navbar-nav"><li class=dropdown uib-dropdown><a class=dropdown-toggle href=# uib-dropdown-toggle> Learn </a> <ul class=dropdown-menu uib-dropdown-menu><li><a href=tutorial> Tutorial </a><li><a href=misc/faq> FAQ </a><li><a href=https://www.youtube.com/user/angularjs> Videos </a><li><a href=http://angular.codeschool.com/> Free Course </a><li><a href=https://www.madewithangular.com/> Case Studies </a></ul><li class=dropdown uib-dropdown><a class=dropdown-toggle href=# uib-dropdown-toggle> Develop </a> <ul class=dropdown-menu uib-dropdown-menu><li><a href=guide> Developer Guide </a><li><a href=api> API Reference </a><li><a href=error> Error Reference </a><li><a href=misc/contribute> Contribute </a><li><a href=https://github.com/angular/angular-seed> Seed App project template </a><li><a href=https://github.com/angular/angular.js> GitHub </a><li><a href=https://github.com/angular/angular.js/blob/master/CHANGELOG.md> Changelog </a><li><a href=http://code.angularjs.org/> Download </a></ul><li class=dropdown uib-dropdown><a class=dropdown-toggle href=# uib-dropdown-toggle> Discuss </a> <ul class=dropdown-menu uib-dropdown-menu><li><a href=http://blog.angularjs.org> Blog </a><li><a href=https://twitter.com/angular> Twitter </a><li><a href=https://plus.google.com/110323587230527980117> Google+ </a><li><a href=https://github.com/angular/angular.js/issues> Feature & Bug Tracker </a><li><a href=http://groups.google.com/group/angular> Mailing List </a><li><a href=http://webchat.freenode.net/?channels=angularjs&uio=d4> IRC </a><li><a href=https://gitter.im/angular/angular.js> Gitter </a></ul></ul></div><div class=search-results-container ng-cloak ng-show=hasResults><div class=container><div class=search-results-frame><div ng-class="colClassName + ' col-group-' + key"ng-repeat="(key, value) in results track by key"ng-show="value.length > 0"class=search-results-group><h4 class=search-results-group-heading>{{ key }}</h4><ul class=search-results><li ng-repeat="item in value"class=search-result><a ng-href="{{ item.path }}"ng-click=handleResultClicked($event)> {{ item.name }} </a></ul></div></div><a class=search-close href ng-click=hideResults()> <span class="glyphicon glyphicon-remove search-close-icon"> </span> Close </a></div></div></div></nav><nav class="navbar navbar-fixed-top"id=navbar-notice><div class=navbar-inner><div class=container><p class="site-notice visible-phone">This site refers to AngularJS (v1.x). <a href=https://angular.io/> Go to the latest Angular </a> .<p class="site-notice visible-desktop">This site and all of its contents are referring to AngularJS (version 1.x), if you are looking for the latest Angular, please visit <a href=https://angular.io/> angular.io </a> .</div></div></nav><nav class="sup-header navbar navbar-fixed-top"id=navbar-sub ng-cloak scroll-y-offset-element><div class="container main-grid main-header-grid"><div class=grid-left><version-picker> </version-picker></div><div class=grid-right><ul class=nav-breadcrumb><li class="nav-breadcrumb-entry naked-list"ng-repeat="crumb in breadcrumb"><span class=divider> / </span> <a ng-href={{crumb.url}}> {{crumb.name}} </a></ul></div></div></nav></header><section class="container main-body"ng-cloak role=main><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 }}"class=nav-index-group-heading ng-class=navClass(navGroup)> {{ navGroup.name }} </a> <ul class=aside-nav><li ng-repeat="navItem in navGroup.navItems"class=nav-index-listing ng-class=navClass(navItem)><a href={{navItem.extra.href}} ng-class=navClass(navItem.extra) ng-if=navItem.extra.href> {{navItem.extra.text}} <i class=icon-{{navItem.extra.icon}} ng-if=navItem.extra.icon> </i> </a> <a href={{navItem.href}} ng-class=linkClass(navItem) tabindex=2> {{navItem.name}} </a></ul></ul><a class="toc-close visible-xs"href ng-click=toc=false> <span class="glyphicon glyphicon-remove toc-close-icon"> </span> Close </a></div></div><div class=grid-right><div ng-show=loading>Loading …</div><div ng-show=loadingError>There was an error loading this resource. Please try again later.</div><div autoscroll ng-hide=loading ng-include=partialPath toc-collector></div></div></div></section><footer class=footer><div class=container><p class=pull-right><a back-to-top> Back to top </a><p>Super-powered by Google ©2010-2020 ( <a title="Changelog of this version of AngularJS"id=version ng-bind-template=v{{version}} ng-href=https://github.com/angular/angular.js/blob/master/CHANGELOG.md#{{versionNumber}}> </a> )<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> .</div></footer></div>