Good morning. I am working on a project of a web page where I use Angularjs.
The case is that they sent a controller where I use a .component and the template and I have no idea how it is done, I started doing something looking on the internet but it does not work that way. The thing is that when I open my page I see a bar above everything where an option that is called 'information' comes out, when I click on 'information I would have to show what I supposedly do with the .component.
I leave here all the code I am using.
The java script where I try to use the component:
angular.module('formApp', ['ui.router']);
angular.module('formApp').config(function ($stateProvider) {
$stateProvider
.state('informacion', {
url: 'informacion',
controller: 'InfoAppCtrl as form',
templateUrl: '/scripts/templates/info.html'
.component('AppForm', {
template: '<div class="container text-center" style="padding-top:60px;" ui-view></div>'
})
})
});
Here I leave the driver that I made apart from the main one to create the template:
angular.module('formApp').controller('AppRespCtrl', function ($scope, $http) {
var validarResp = this;
validarResp.name = 'respuesta';
});
The HTML:
<h1>Template respuesta {{AppForm.name}}</h1>
And the Layout where I place the div so that it shows me what I said before:
<div class="container body-content">
@RenderBody()
@RenderSection("SPAViews", required: false)
<hr />
<footer>
<div class="container text-center" style="padding-top:20px;" ui-view></div>
<p>© @DateTime.Now.Year - My ASP.NET Application</p>
</footer>
</div>