AngularJS encountered an unhandled syntax error

My current approach involves utilizing the code below to display data fetched from Parse API into a table using AngularJS and Bootstrap. However, the JavaScript section where I have defined the controller doesn't seem to be running as expected. Below is a snippet of the HTML code:

index.js

<!DOCTYPE html>
<html data-ng-app="parseApp">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.14/angular.min.js"></script>  
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
</head>
<body >

<div class= "container" data-ng-controller="ParseController" >
<table class="table" >
<thead>
<tr>
<th>Email</th>
<th>Phone</th>
</tr>
</thead>
<tbody> 
<tr data-ng-repeat="temp in user">
            <td>{{temp.email}}</td>
            <td>{{temp.phone}}</td>
 </tr>

</tbody>           
</table>

</div>


<script type="text/javascript"> 
var parse = angular.model('parseApp',[]);

function ParseController($scope, $http)
{
$http({method : 'GET',url :'https://api.parse.com/1/classes/User',

headers: {'X-Parse-Application-Id': 'XXXXXXX',
         'X-Parse-REST-API-Key':'XXXXXX',
          }}).success(function(data,status) {

            console.log(data);
$scope.user = data;
}).error(function(data,status)
{

}
parse.controller('ParseController',ParseController);

}
</script>
</body>
</html>

Answer №1

There appears to be a syntax mistake

.error(function(data,status)
{

});

Additionally, please note that it should be angular.module, not angular.model

Answer №2

The issue with the code lies within the error handler itself:

.error(function(data,status)
{

});

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Guide to automatically inserting text into an html form and submitting it without manual intervention

Currently, I am in the process of a project where my main goal is to design an HTML form for submitting replies. One interesting feature I want to include is an option for users who are feeling lazy to simply click on "auto-generate comment", which will ...

pm2 is launching multiple instances of identical next.js applications

I am in the process of deploying my Next.js app on my local PC. Below are the contents of my configuration and package.json files: // package.json { "name": "smarf", "private": true, "scripts": { "dev ...

Combining PHP and MySQL with a join statement

I am trying to calculate the average rating for each store in a directory list using MySQL's AVG function. Whenever someone reviews a store, they assign a rating ranging from 1 to 5. This rating is then inserted into the rating column of the reviews ...

Bot is being inundated with messages containing no content

My discord.js version is 14.0.3. I'm facing an issue where the message content is not being retrieved correctly. To solve this, I set up a client.on('messageCreate') event handler: client.on('messageCreate', async (message) => ...

Utilizing JQuery to differentiate a single element within a group of elements

As a beginner in the world of jquery, I am attempting to assign a font awesome icon star (fa-star) to differentiate between admins and regular members within the group members bar. The usernames have been blurred out for privacy reasons, but my goal is to ...

Remove HTML formatting from excel cells and fill separate cells

Is there a way to condense HTML code and fill different columns in Excel? For instance, If my HTML code looks like this: <p></p>10-16-2013 22:35<br/>I love pizza! Ordering was a breeze!<p></p>10-16-2013 13:19:46<br />t ...

How to keep an image anchored at the bottom of the page without overlapping other content

I'm trying to have a logo image stay fixed at the bottom of a navigation drawer, but when I use absolute positioning and set it to the bottom, it overlaps with the list items on shorter devices. When the scroll bar appears due to shrinking the browser ...

What is the solution for preventing mysql functions from escaping when using node-mysql?

When trying to incorporate the MySQL function "now()" into an insert statement using the node-mysql module, I encountered an issue: var insert = { username: 'foo', date_joined: 'now()', }; connection.query('INSERT INTO users ...

Adjust the size and orientation of an image according to the dimensions of the window and the image

As I delve into HTML and Javascript, I am facing a challenge with resizing an image based on the window size. The goal is for the image to occupy the entire window while maintaining its aspect ratio during resizing. Additionally, if the window size exceeds ...

The DB GridFS API is causing files to become corrupt when downloading .zip files

Background Information: An application built with Node.js and Loopback that requires data from legacy enterprise CRM systems to be stored in its database. The data is provided in the form of a .zip file, which needs to be saved using GridFS for production ...

Swap the content of one div with another div using client-side code only

Currently, I am in the process of developing my personal website. To enhance user experience, I have implemented a vertical navigation bar on the left side of the page. My goal is to replace the content of a specific div with content from other HTML files ...

Express router issue: No default engine was set and no file extension given

I attempted to build a login page, but encountered an error when visiting localhost:5000. Error: No default engine was specified and no extension was provided. at new View (C:\docs\diplom\master3\node_modules\express\lib\ ...

How do I resolve the issue of unable to align the element correctly?

I am struggling to create a hamburger menu icon and align it using flexbox. Unfortunately, the icon is not aligning properly as it is going beyond the menu and the browser screen with an odd top indent. Below is the code I have written: * { margin: 0 ...

Is there a bug in NodeJS that causes an error when a return statement is used with a line feed before the string to be returned?

I am attempting to call a function from a module in order to generate an HTML string. When the function is written with a line feed (LF) between the return statement and the string declaration as shown below, the return value becomes "undefined"... export ...

What is the best way to start the server when the files are located in separate directories?

I have organized my project into two separate folders, one for the client and one for the server Is there a way to use npm start to simultaneously run both the frontend and backend scripts? Check out the screenshot below: View of Two Folders in my Projec ...

Switch up the positioning of elements using jQuery

My webpage contains multiple elements that are absolutely positioned with the CSS attribute "top." I am looking to adjust the top position of each element by 20px. This involves retrieving the current top position and adding 20px to it. The quantity of e ...

What's causing ng-show to malfunction in IE11 on AngularJS?

I am experiencing a strange issue with my code - ng-show works perfectly fine on Firefox, but not on IE 11. <div ng-show="isExist" class="panel panel-default"> Here is the relevant code snippet from the controller: $scope.isExist = false; if(user ...

Releasing Typescript 2.3 Modules on NPM for Integration with Angular 4

Although there are instructions available in Writing NPM modules in Typescript, they are outdated and there are numerous conflicting answers that may not be suitable for Angular. Additionally, Jason Aden has delivered an informative presentation on youtu ...

My attempt at creating a straightforward sorting function turned out to be ineffective

My attempt at creating a basic sorting function seems to be failing as it is still returning the original list instead of the sorted one. function sortByPopular (collection) { let items = collection.slice(); items.sort(function(a,b) { re ...

"Troubleshooting guide: Installing SQLite3 module on Node.js despite encountering installation errors

I am having trouble installing the sqlite module. When I try to install it using the command $ npm install sqlite3, I encounter an error. What should I do? To fix this issue, you can try running the following command: [email protected] install D:&bs ...