1

I have a blade view in laravel 5 along with my angular code as below

<li ng-if="data != null" class="item" style="height: 120px;"  data-ng-repeat="page in data | filter:searchDefaultTerm">
  <div style="margin: 5px;">
     <a href="<% page.guid %>"><span class="fa fa-eye pull-right"></span></a>
     <a href="{{ url('/administrator/page/edit/'.'<% page.id %>')}}" ><i class="fa  fa-pencil pull-right"></i></a>
     <a class="trashButton" href="{{ url('/administrator/page/delete/'.'<% page.id %>') }}" style="cursor: pointer;"><i class="fa fa-trash-o pull-right"><  /i></a>
  </div>
   <img class="pull-left product-img" style="margin: 5px;" height="100" width="100" src="<% page.image %>">
   <a class="product-title "><% page.title %></a><br/>
     <em style="margin: 5px;">Menu Title:</em> <a  class="product-title "><% page.menuTitle %></a><br/>             
     <em style="margin: 5px;">Added Date:</em> <a  class="product-title "><% page.addedDate %></a><br/>
     <em style="margin: 5px;">Updated Date:</em> <a  class="product-title "><% page.updateDate %></a>
</li>

Everything was woking fine in the angular development server but as soon as I moved it to wamp server I am getting the following error

Use of undefined constant page - assumed 'page'

This is my angular code defining new start and end symbol for angular I dont have error with in my console caused due to angular

/*
* Angular App
*/
var app = angular.module('customApp',[],function($interpolateProvider){
    $interpolateProvider.startSymbol('<%');
    $interpolateProvider.endSymbol('%>');
});

I have also tried this

var app = angular.module('customApp', []);

app.config(function($interpolateProvider) {
    $interpolateProvider.startSymbol('<%');
    $interpolateProvider.endSymbol('%>');
});

This is the screenshot of error I have received enter image description here

5
  • Look here Commented May 25, 2015 at 11:16
  • i have already done what it said using Angular’s $interpolateProvider but still having some problem@SulthanAllaudeen Commented May 25, 2015 at 11:23
  • You made all config as like said here ?\ Commented May 25, 2015 at 11:24
  • i did so still not woking @SulthanAllaudeen Commented May 25, 2015 at 11:37
  • Whao ! After fresh installation or laravel-5 here's the solution that i have posted in the answer .. And it helped in my project as well. Thanks for your question +1 :) Commented May 25, 2015 at 12:16

1 Answer 1

0

After a fresh installation of laravel-5. Here's the solution to you

Here's the welcome.blade.php

<html>
    <head>
        <title>Laravel</title>

        <link href='//fonts.googleapis.com/css?family=Lato:100' rel='stylesheet' type='text/css'>
        {!! HTML::style('public/css/app.css') !!} 
        {!! HTML::script('public/js/angular.min.js'); !!}
    </head>
    <body>
    @include('angular-stuff'); <!-- app/views/angular-stuff.php -->     
    </body>
</html>

There have a angular-stuff.php file in your app/views folder

Inside your angular-stuff.php have the below code

<div ng-app="">
    <p>Name : <input type="text" ng-model="name"></p>
    <h1>Hello {{name}}</h1>
</div>

Then it should work without any other configuration.

Note : Your file your be angular-stuff.php not angular-stuff.blade.php

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.