0
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
<p>
First Name: <input type="text" ng-model="firstName"><br>
Last Name: <input type="text" ng-model="lastName"><br>
<br>
Full Name: {{firstName + " " + lastName}}
</p>
</div>

<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
    $scope.firstName = "John";
    $scope.lastName = "Doe";
});
</script>

</body>
</html>

from the above code , which was placed in some text file , i need to convert it to angular 2 code by using file handling methods in c#. so i need to replace

ng-model to [(ngModel)]

and i need to copy from 7th line i.e .,

... to

to some text file...it acts as component.html and i need to copy
$scope.first Name = "John";
$scope.last Name = "Doe"; 

and removing $scope we get,

first Name = "John";
last Name = "Doe";

This need to b copied and place in one text file file which already contains the basic code( like import...) to represent the component.ts file..

0 Answers0