I am taking my first steps in the world of web development with Angular (and JavaScript in general). I have been trying to rewrite some basic and common examples using Angular. One thing I attempted was to display a simple message using data binding. This is what I came up with:
var app = angular.module("myModule", []);
var myCtrl = function($scope) {
$scope.message = "YES";
};
app.controller("myCtrl", myCtrl);
When I tried this in Plunker, it worked but I received two warnings:
- "unexpected early end of program" (in line 5)
- "expected an identifier and instead saw '(end)'. Missing semicolon" (in line 6)
I am still struggling with JavaScript syntax and haven't found a clear explanation for this issue yet. Can someone please help me understand this better? Thank you.