view raw
Kati Ais Kati Ais - 6 months ago 25
AngularJS Question

json not working in Angular

I'm a beginner in Angular so I hope someone to help me!

This is my script.js

ar app = angular.module('computer', ['ngRoute'])
.config(['$routeProvider',function($routeProvider) {
.when('/main', {
templateUrl : 'main.html',
controller : 'MainCtrl'
.when('/service', {
templateUrl : 'service.html',
controller : 'ServicesCtrl'
.controller('MainCtrl', ['$scope', function($scope){


.controller('ServicesCtrl', ['$scope','$http', function($scope,$http){
$ =;

and this is service.html

<div class="row">
<div class="col-md-12">
<div ng-repeat="serv in services">
<div class="row service">
<div class="col-md-2">
<img src="computer-icon.png" class="img-responsive">
<div class="col-md-10">
<h3>{{ : }}</h3>
<button class="btn btn-primary">Read Moreā€¦</button>

and serviceData.json

"id": 1,
"name": "Reparation",
"Description": "Reparation of your hardware"
}, {
"id": 2,
"name": "Installation",
"Description": "Installation of your hardware"
}, {
"id": 3,
"name": "Reparation and Reset",
"Description": "Reparation and Reset of your hardware"

But I have this error in console
angular.min.js:118 Error: [$parse:syntax]$parse/syntax?p0=%3A&p1=is%20an%20unexpected%20token&p2=9&

and anything display in screen.
Thank you for help !


You have to use the following line:

<h3>{{ : }}</h3>

like this:

<h3>{{}} : {{ }}</h3>