title: Angular JS works in main layout(view) but not in child view of laravel 4.2
body: <p>I'm trying to use Angular JS with Laravel 4.2. I've changed the blade's default {{}} into [[]], it works perfectly, now the problem is that when I puts Angular JS code in main layout (view) it works but when I put Angular JS code in a child view(actually child view extends the main layout and section is yielded using @section('contents') ...Angular JS code... @stop) it doesn't work at all, browser can't render the Angular JS exprerssion and shows it as it is in code editor! Here is my "main layout.blade.php" and "child.blade.php":</p>
  
  <p>"main.layout.blade.php"</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;title&gt;Customer Management&lt;/title&gt;
  
      &lt;!-- Bootstrap --&gt;
      [[ HTML::style('css/bootstrap.min.css') ]]
      [[ HTML::style('css/custom.css') ]]
  
      [[--angular js files--]]
      [[HTML::script('/js/angular/angular.min.js')]]
      [[HTML::script('/js/controllers.js')]]
  
      [[--jquery bootsrtap js files--]]
      [[ HTML::script('js/respond.js') ]]
      [[ HTML::script('js/jquery-1.11.2.min.js') ]]
      [[ HTML::script('js/bootstrap.min.js') ]]
  
  &lt;/head&gt;
  
  &lt;body&gt;
  
      @include('layouts.main-menu')
  
      &lt;div class="container" id="container"&gt;
          &lt;div ng-app=""&gt;&lt;!-- This Angular JS works fine --&gt;
              &lt;p&gt;Name : &lt;input type="text" ng-model="name"&gt;&lt;/p&gt;
              &lt;h1&gt;Hello {{name}}&lt;/h1&gt;
          &lt;/div&gt;
  
          @yield('content')
      &lt;/div&gt;
  
      @include('layouts.footer')
  
  
      &lt;script&gt;
          $("nav ul li").on("click", function() {
              $("nav ul li").removeClass("active");
              $(this).addClass("active");
          });
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Child.blade.php</p>
  
  <pre><code>@extends('layouts.main')
  &lt;!doctype html ng-app="myApp"&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;title&gt;Document&lt;/title&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  
      @section('content')
          &lt;div ng-app=""&gt;&lt;!-- This Angular JS doesn't work fine --&gt;
              &lt;p&gt;Name : &lt;input type="text" ng-model="name1"&gt;&lt;/p&gt;
              &lt;h1&gt;Hello {{name1}} &lt;/h1&gt;
          &lt;/div&gt;
      @stop
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>You can see clearly that same Angular Code snippet is used in both files but in "layout.main.blade.php" it works and in "child.blade.php" it doesn't work as it is in between @section('content') ... @stop I can't get understand why this is and how to solve it!!!!!!</p>
  
  <p>This is the response from network panel:</p>
  
  <pre><code>GET localhost:8000
  
  200 OK
  
  localhost:8000
  
  3.4 KB
  
  [::1]:8000
  
  
  141ms
  HeadersResponseHTMLCacheCookies
  
  &lt;!doctype html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;title&gt;Document&lt;/title&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;title&gt;Customer Management&lt;/title&gt;
  
      &lt;!-- Bootstrap --&gt;
      &lt;link media="all" type="text/css" rel="stylesheet" href="http://localhost:8000/css/bootstrap.min
  .css"&gt;
  
      &lt;link media="all" type="text/css" rel="stylesheet" href="http://localhost:8000/css/custom.css"&gt;
  
  
  
          &lt;script src="http://localhost:8000/js/angular/angular.min.js"&gt;&lt;/script&gt;
  
      &lt;script src="http://localhost:8000/js/controllers.js"&gt;&lt;/script&gt;
  
  
          &lt;script src="http://localhost:8000/js/respond.js"&gt;&lt;/script&gt;
  
      &lt;script src="http://localhost:8000/js/jquery-1.11.2.min.js"&gt;&lt;/script&gt;
  
      &lt;script src="http://localhost:8000/js/bootstrap.min.js"&gt;&lt;/script&gt;
  
  
  &lt;/head&gt;
  
  &lt;body&gt;
  
      &lt;div class="row"&gt;
      &lt;nav class="navbar navbar-default navbar-fixed-top navbar-inverse"&gt;
          &lt;div class="navbar-header"&gt;
              &lt;button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#collapse"
  &gt;
                  &lt;span class="sr-only"&gt;Toggle navigation&lt;/span&gt;
                  &lt;span class="glyphicon glyphicon-arrow-down"&gt;&lt;/span&gt;
                  MENU
              &lt;/button&gt;
          &lt;/div&gt;
          &lt;div class="collapse navbar-collapse" id="collapse"&gt;
              &lt;ul class="nav navbar-nav"&gt;
                                                      &lt;li class="active"&gt;&lt;a href="/" &gt;&lt;span class="glyphicon
   glyphicon-home"&gt;&lt;/span&gt; Home&lt;/a&gt;&lt;/li&gt;
                                  &lt;!--&lt;li class="dropdown"&gt;&lt;a href="#" data-toggle="dropdown"&gt;Dropdown
   &lt;span class="caret"&gt;&lt;/span&gt;&lt;/a&gt;
                      &lt;ul class="dropdown-menu"&gt;
                          &lt;li&gt;&lt;a href="#"&gt;Dr. Winthrop&lt;/a&gt;&lt;/li&gt;
                          &lt;li&gt;&lt;a href="#"&gt;Dr. Chase&lt;/a&gt;&lt;/li&gt;
                          &lt;li&gt;&lt;a href="#"&gt;Dr. Sanders&lt;/a&gt;&lt;/li&gt;
                      &lt;/ul&gt;
                  &lt;/li&gt;--&gt;
                  &lt;li&gt;&lt;a href="cv/index"&gt;&lt;span class="glyphicon glyphicon-edit"&gt;&lt;/span&gt; Make CV&lt;/a&gt;&lt;/li
  &gt;
                  &lt;li&gt;&lt;a href="#"&gt;&lt;span class="glyphicon glyphicon-eye-open"&gt;&lt;/span&gt; Example&lt;/a&gt;&lt;/li&gt;
  
                  &lt;li&gt;&lt;a href="#"&gt;&lt;span class="glyphicon glyphicon-info-sign"&gt;&lt;/span&gt; About&lt;/a&gt;&lt;/li&gt;
              &lt;/ul&gt;
  
              &lt;ul class="nav navbar-nav navbar-right"&gt;
                                      &lt;li&gt;&lt;a href="http://localhost:8000/users/signin"&gt;Sign in&lt;/a&gt;&lt;/li
  &gt;
                      &lt;li&gt;&lt;a href="http://localhost:8000/users/newaccount"&gt;Sign Up&lt;/a&gt;&lt;/li&gt;
                              &lt;/ul&gt;
  
          &lt;/div&gt;
      &lt;/nav&gt;
  &lt;/div&gt;
  
  
      &lt;div class="container" id="container"&gt;
          &lt;div ng-app=""&gt;
              &lt;p&gt;Name : &lt;input type="text" ng-model="name"&gt;&lt;/p&gt;
              &lt;h1&gt;Hello {{name}}&lt;/h1&gt;
          &lt;/div&gt;
  
                  &lt;div ng-app=""&gt;
              &lt;p&gt;Name : &lt;input type="text" ng-model="name1"&gt;&lt;/p&gt;
              &lt;h1&gt;Hello {{name1}} &lt;/h1&gt;
          &lt;/div&gt;
          &lt;/div&gt;
  
      &lt;footer class="footer row "&gt;
      &lt;div class="col-lg-4 col-sm-4 col-md-4" id="links"&gt;
          &lt;h4&gt;Links&lt;/h4&gt;
          &lt;ul class="list-unstyled"&gt;
              &lt;li&gt;Link 1&lt;/li&gt;
              &lt;li&gt;Link 2&lt;/li&gt;
              &lt;li&gt;Link 3&lt;/li&gt;
              &lt;li&gt;Link 4&lt;/li&gt;
          &lt;/ul&gt;
      &lt;/div&gt;
  &lt;/footer&gt;
  
      &lt;script&gt;
          $("nav ul li").on("click", function() {
              $("nav ul li").removeClass("active");
              $(this).addClass("active");
          });
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  
  
  1 request
  
  3.4 KB
  
  141ms (onload: 1.06s)
  </code></pre>