I have a laravel app which I'd like to add in an Angular frontend.
My index file, main.blade.php, specifies the name of the app. Here is the structure of my main page... where html partials are piped in through {{ $content }}:
<!doctype html>
<html lang="en" ng-app="myApp">
<head>
...
</head>
<body>
<div id="main-container">
<header>
...
</header>
{{ $content }}
<footer>
...
</footer>
</div>
</body>
</html>
I have another partial page, private events:
<div id="inner-container" class="events" ng-controller="myCtrl">
<li ng-repeat="phone in phones">
<p>{{phone.name}}</p>
</li>
...
</div>
And then a controllers.js file:
var myApp = angular.module('myApp', []);
myApp.controller('myCtrl', function($scope) {
$scope.phones = [
{'name': 'Nexus S',
'snippet': 'Fast just got faster with Nexus S.'},
{'name': 'Motorola XOOM™ with Wi-Fi',
'snippet': 'The Next, Next Generation tablet.'},
{'name': 'MOTOROLA XOOM™',
'snippet': 'The Next, Next Generation tablet.'}
];
});
I'm getting an Unhandled exception: Error rendering view: [content.private-events]. Use of undefined constant phone - assumed 'phone'
Given my file structure, can't I just link in an Angular app like that? Do I have to add the controller name to the tag, or can I use any DOM element container?
Thanks