Angular data binding > variables not rendering

I'm attempting a simple example, but for some reason the values are not rendering in the browser (appear as {{user.firstName}} in the web page).  

I verfied my code matches exactly with the text book example as well as instructor demos. It also exactly mirrors other examples on w3schools.   I can't figure out why its not working. 

Here's my main.js:


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

myApp.controller('UserController',function UserController($scope){
    $scope.user = {
        firstName: 'Peebo',
        lastName: 'Sanderson'
    };
});


Here is my index.html:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Data Binding</title>
    <script> src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js"</script>
    <script> src="main.js"</script>
</head>

<body ng-app="myApp">

    <h1>Data Binding Using AngularJS</h1>
    <div ng-controller="UserController">
        <p>First: {{user.firstName}}</p>
        <p>Last: {{user.lastName}}</p>
    </div>

</body>
</html>

1 Reply

IL Indhumathy Loganathan Syncfusion Team July 20, 2023 10:15 AM UTC

Hi Julie,


Greetings from Syncfusion support.


From the shared explanation, we were not clear about your query and the exact Syncfusion control used at your end. Could you please refer to our documentation site and confirm the exact control you have been using at your end.


https://help.syncfusion.com/angularjs/overview


Based on the shared details, we will assist you promptly.


Regards,

Indhumathy L


Loader.
Up arrow icon