Chapter3 Form submission in Angular4

   

It will generate form.component.ts,form.component.html,form.component.css.  

  form.component.html  

    app.module.ts  

  app.component.html  

 

Chapter2 Services in angular4

app.component.html

app.component.ts  

    app.module.ts  

Generate component type in terminal

  student-data.service.ts  

   

Filter in AngularJs

<!DOCTYPE html> <html> <head> <script src=”http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js”></script> <script> var app=angular.module(‘myApp’,[]); app.controller(‘ct’,function($scope){ $scope.arr=[“Shiv”,”Jagan”]; }); </script> </head> <body> <div ng-app=”myApp” id=”u” ng-controller=”ct”> Name<input type=”text” ng-model=”userName”/> <ul> <li ng-repeat=”x in arr|filter:userName”> User Name:{{x}} </ul> </div>