Faizah Pratiwi Faizah Pratiwi - 11 days ago 5x
AngularJS Question

Cant read the controller

I've just learned AngularJs. I've try to show a data from controller. but the data not show.
my view :

<!DOCTYPE html>
<title>Belajar AngularJs</title>
<body ng-app="FirstApp">
<div ng-controller="MainController">
{{title}} </br>
{{book.title}} </br>
{{book.author}} </br>

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.6/angular.min.js"></script>
<script src="js/app.js"></script>
<script src="controllers/MainController.js"></script>
<script type="text/javascript"></script>

my controller :

app controller('MainController',['$scope', function ($scope) {
// body...
$scope.title='Belajar AngularJs';
title: 'Belajar Angularjs Bersama Ciwuk',
author : 'Ciwuk';
price : 'Free'

my model :

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

the result was like this :

anyone help me please? i'm new in angularJS


You should use app.controller and author : 'Ciwuk',. Use comma not semicolon. Try use console(F12) when error happen.