Re: Value from controller to View

33 views
Skip to first unread message
Message has been deleted

Charly Poly

unread,
Jul 11, 2014, 4:35:01 AM7/11/14
to ang...@googlegroups.com
Hi Suraj,

Are you sure that angular is loaded ?

I see this :
"lib/Angular/angular.min.js" and i'm wondering if "Angular" should not be "angular" instead ?

Please provide an Plunker so we can help you if the issue is still here.

Regards,
Charly.

On Friday, 11 July 2014 10:15:01 UTC+2, Suraj S Thapa wrote:
Hi all, 

I am new to the AngularJs. Reading the online tutorial I tried following, 

controller.js:

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

myApp.controller("controller",
        function controller($scope){
                $scope.meal =   {
                        'breakfast' : 'Orange Juice',
                        'Lunch'         : 'Fruit Salad',
                        'Dinner'        : 'Vegetable Rice'
                }
        }
)

index.html:

<!doctype html>
<html ng-app="myApp">
<head>
        <title>Angular Course</title>
        <script src="lib/Angular/angular.min.js" ></script>
        <script src="js/controllers.js"></script>
</head>
<body>
        <div ng-controller = "controller">
                <h1>{{meal.breakfast}}</h1>
        </div>
</body>
</html>

I am expecting value of meal.breakfast in web page but I am getting following, 


{{meal.breakfast}}


Could any one please guide me what is wrong? Thank you in advance.

Regards

Message has been deleted

Guillaume Corré

unread,
Jul 11, 2014, 4:53:37 AM7/11/14
to ang...@googlegroups.com
Hi Suraj,

Your script file is named "controller.js" while you are requesting "controllerS.js" with an extra 's'.

Cheers.


On Fri, Jul 11, 2014 at 10:49 AM, Suraj S Thapa <thapa.s...@gmail.com> wrote:
Hi Charly, 

Thanks for your help. Please find the link below, 


Regards, 

Suraj



--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/jqWG_17yMlE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.



--
Suraj Thapa

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages