"Fossies" - the Fresh Open Source Software Archive

Member "angular-1.7.9/docs/partials/api/ng/function/angular.bootstrap.html" (26 Nov 2019, 4793 Bytes) of package /linux/www/angular-1.7.9.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) HTML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 <a href='https://github.com/angular/angular.js/edit/v1.7.x/src/Angular.js?message=docs(angular.bootstrap)%3A%20describe%20your%20change...#L1733' class='improve-docs btn btn-primary'><i class="glyphicon glyphicon-edit">&nbsp;</i>Improve this Doc</a>
    2 
    3 
    4 
    5 <a href='https://github.com/angular/angular.js/tree/v1.7.9/src/Angular.js#L1733' class='view-source pull-right btn btn-primary'>
    6   <i class="glyphicon glyphicon-zoom-in">&nbsp;</i>View Source
    7 </a>
    8 
    9 
   10 <header class="api-profile-header">
   11   <h1 class="api-profile-header-heading">angular.bootstrap</h1>
   12   <ol class="api-profile-header-structure naked-list step-list">
   13     
   14     <li>
   15       - function in module <a href="api/ng">ng</a>
   16     </li>
   17   </ol>
   18 </header>
   19 
   20 
   21 
   22 
   23 
   24 <div class="api-profile-description">
   25   <h2 id="overview">Overview</h2>
   26   <p>Use this function to manually start up AngularJS application.</p>
   27 <p>For more information, see the <a href="guide/bootstrap">Bootstrap guide</a>.</p>
   28 <p>AngularJS will detect if it has been loaded into the browser more than once and only allow the
   29 first loaded script to be bootstrapped and will report a warning to the browser console for
   30 each of the subsequent scripts. This prevents strange results in applications, where otherwise
   31 multiple instances of AngularJS try to work on the DOM.</p>
   32 <div class="alert alert-warning">
   33 <strong>Note:</strong> Protractor based end-to-end tests cannot use this function to bootstrap manually.
   34 They must use <a href="api/ng/directive/ngApp">ngApp</a>.
   35 </div>
   36 
   37 <div class="alert alert-warning">
   38 <strong>Note:</strong> Do not bootstrap the app on an element with a directive that uses <a href="api/ng/service/$compile#transclusion">transclusion</a>,
   39 such as <a href="api/ng/directive/ngIf"><code>ngIf</code></a>, <a href="api/ng/directive/ngInclude"><code>ngInclude</code></a> and <a href="api/ngRoute/directive/ngView"><code>ngView</code></a>.
   40 Doing this misplaces the app <a href="api/ng/service/$rootElement"><code>$rootElement</code></a> and the app&#39;s <a href="api/auto/service/$injector">injector</a>,
   41 causing animations to stop working and making the injector inaccessible from outside the app.
   42 </div>
   43 
   44 <pre><code class="lang-html">&lt;!doctype html&gt;
   45 &lt;html&gt;
   46 &lt;body&gt;
   47 &lt;div ng-controller=&quot;WelcomeController&quot;&gt;
   48   {{greeting}}
   49 &lt;/div&gt;
   50 
   51 &lt;script src=&quot;angular.js&quot;&gt;&lt;/script&gt;
   52 &lt;script&gt;
   53   var app = angular.module(&#39;demo&#39;, [])
   54   .controller(&#39;WelcomeController&#39;, function($scope) {
   55       $scope.greeting = &#39;Welcome!&#39;;
   56   });
   57   angular.bootstrap(document, [&#39;demo&#39;]);
   58 &lt;/script&gt;
   59 &lt;/body&gt;
   60 &lt;/html&gt;
   61 </code></pre>
   62 
   63 </div>
   64 
   65 
   66 
   67 
   68 <div>
   69   
   70 
   71   
   72 
   73   <h2 id="usage">Usage</h2>
   74     
   75       <p><code>angular.bootstrap(element, [modules], [config]);</code></p>
   76 
   77 
   78     
   79 
   80     
   81 <section class="api-section">
   82   <h3 id="angular.bootstrap-arguments">Arguments</h3>
   83 
   84 <table class="variables-matrix input-arguments">
   85   <thead>
   86     <tr>
   87       <th>Param</th>
   88       <th>Type</th>
   89       <th>Details</th>
   90     </tr>
   91   </thead>
   92   <tbody>
   93     
   94     <tr>
   95       <td>
   96         element
   97         
   98         
   99       </td>
  100       <td>
  101         <a href="" class="label type-hint type-hint-domelement">DOMElement</a>
  102       </td>
  103       <td>
  104         <p>DOM element which is the root of AngularJS application.</p>
  105 
  106         
  107       </td>
  108     </tr>
  109     
  110     <tr>
  111       <td>
  112         modules
  113         
  114         <div><em>(optional)</em></div>
  115       </td>
  116       <td>
  117         <a href="" class="label type-hint type-hint-array">Array&lt;String|Function|Array&gt;=</a>
  118       </td>
  119       <td>
  120         <p>an array of modules to load into the application.
  121     Each item in the array should be the name of a predefined module or a (DI annotated)
  122     function that will be invoked by the injector as a <code>config</code> block.
  123     See: <a href="api/ng/function/angular.module">modules</a></p>
  124 
  125         
  126       </td>
  127     </tr>
  128     
  129     <tr>
  130       <td>
  131         config
  132         
  133         <div><em>(optional)</em></div>
  134       </td>
  135       <td>
  136         <a href="" class="label type-hint type-hint-object">Object</a>
  137       </td>
  138       <td>
  139         <p>an object for defining configuration options for the application. The
  140     following keys are supported:</p>
  141 <ul>
  142 <li><code>strictDi</code> - disable automatic function annotation for the application. This is meant to
  143 assist in finding bugs which break minified code. Defaults to <code>false</code>.</li>
  144 </ul>
  145 
  146         
  147       </td>
  148     </tr>
  149     
  150   </tbody>
  151 </table>
  152 
  153 </section>
  154     
  155 
  156     <h3 id="angular.bootstrap-returns">Returns</h3>
  157 <table class="variables-matrix return-arguments">
  158   <tr>
  159     <td><a href="" class="label type-hint type-hint-auto">auto.$injector</a></td>
  160     <td><p>Returns the newly created injector for this app.</p>
  161 </td>
  162   </tr>
  163 </table>
  164 
  165   
  166   
  167   
  168 
  169 
  170 
  171   
  172 </div>
  173 
  174