So thought the previous post was the last one, but guess what I was just having a typo in the controller. This is huge relief for me.
Here what I followed from the tutorial was that you can actually create a controller for your app, and Include it using ng-controller. Controller is actually a function that use $scope. Through this the model and controller work together.
So here is the Controller;
the HTML page :
This will allow you to have a small input field and set of celebrity names. When you type in for search what is does is it takes the value and filters from the repeters giving you only the filtered results like following.
Here what I followed from the tutorial was that you can actually create a controller for your app, and Include it using ng-controller. Controller is actually a function that use $scope. Through this the model and controller work together.
So here is the Controller;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | /* Controllers */ var myApp = angular.module('myApp',[]); myApp.controller('namectrl',function($scope){ $scope.names = [ { 'Fname' : 'anna', 'Lname' : 'kendrick' }, { 'Fname' : 'jason', 'Lname' : 'mraz' }, { 'Fname' : 'jennifer', 'Lname' : 'aniston' }, { 'Fname' : 'nicole', 'Lname' : 'kidman' }, { 'Fname' : 'jason', 'Lname' : 'segel' }, { 'Fname' : 'ben', 'Lname' : 'affleck' } ]; }); |
the HTML page :
This will allow you to have a small input field and set of celebrity names. When you type in for search what is does is it takes the value and filters from the repeters giving you only the filtered results like following.
when j was typed in
So the DayOne of AngularJS ended Happily.