I have an existing asp.net MVC 5 application with AngularJS and I would like to upgrade the AngularJS to the Angular 6 without rewriting the whole application. I read the official guide, but it didn't really help me a lot. Here is a small example:
I have a view like this that contains another dynamic view that will contain angular directives:
<div id="container" ng-controller="MyController">
@Html.Action("MyView", "Home")
</div>
Controller:
angular.module('myApp').controller('MyController', ['$scope', function($scope) {
$scope.doSomething= function () {
//do stuff
}
}
]);
What would be the best practice to convert such controller to Angular's component? The most difficult part for me is that the component has to work with a template that generated on the server.
The closest answer that I found is How to render asp.net mvc view into angular 2?, but looks like it doesn't work in Angular 6 and I'm not sure this is the way to go.
Please advise.