Yesterday,I posted a question on AngularJS.
Then I found the solution but still I don't know the difference b/w these 2 code snippets
NOT WORKING:
{{8*9}}
{{message}}
var mainController=function($scope){
$scope.message="Hello";
};
Note: This is working fine when I watched a Video and the guy is using Plnkr.co to run this.
Working:
{{8*9}}
{{message}}
var app = angular.module("myApp", []);
app.controller("mainController", function($scope) {
$scope.message="Hello";
});
Please Someone explain it!!!!

Bhuvanesh MohankumarRank #310 · 8.1K reputationPosted May 15, 2016, 12:04 AM EDT
Bhuvanesh MohankumarRank #310 · 8.1K reputationPosted May 12, 2016, 9:24 PM EDT
Hi Viipiin,
Bhuvanesh MohankumarRank #310 · 8.1K reputationPosted May 12, 2016, 10:17 PM EDT
Hi Viipiin,
Vipin TyagiRank #868 · 2.5K reputationPosted May 13, 2016, 12:28 AM EDT
Bhuvanesh MohankumarRank #310 · 8.1K reputationPosted May 13, 2016, 1:02 AM EDT
Yes Viipiin,
its same but I have just recommended youto add the controllerto the app module here, to make you understand the difference of your code and what I have provided.
Vipin TyagiRank #868 · 2.5K reputationPosted May 15, 2016, 9:34 PM EDT
It's amazing.I was watching videos with full concentration and I missed the info.
Bhuvanesh MohankumarRank #310 · 8.1K reputationPosted May 17, 2016, 1:42 AM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts