This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Versión 1 | |
namespace WebApiSwaggerVersion.Controllers.V1 | |
{ | |
[ApiController] | |
[Route("api/v1/[controller]")] | |
public class WeatherForecastController : ControllerBase | |
{...} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNetCore.Identity; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.IdentityModel.Tokens; | |
using System; | |
using System.Collections.Generic; | |
using System.IdentityModel.Tokens.Jwt; | |
using System.Linq; | |
using System.Security.Claims; | |
using System.Text; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using Microsoft.AspNetCore.Hosting | |
@using Microsoft.AspNetCore.Mvc.ViewEngines | |
@inject IWebHostEnvironment Environment | |
@inject ICompositeViewEngine Engine | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>@ViewData["Title"] - BlazorApp_Scaffolding3.Server</title> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNetCore.Http; | |
using Microsoft.Extensions.Hosting; | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace BlazorMovies.SharedBackend.Helpers | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function initializeCounterComponent(container) { | |
var chart = container.querySelector('#myChart'); | |
inicializarChart(chart); | |
var button = container.querySelector("#counterClick"); | |
var title = container.querySelector("h1"); | |
if (button) { | |
button.addEventListener("click", (e) => { | |
let button = e.target; | |
button.innerHTML = "Hello"; | |
title.innerHTML = "The button has been clicked!"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@page "/counter" | |
@inject IJSRuntime js | |
<div @ref="container" class="counter-container"> | |
<h1>Counter</h1> | |
<p>Current count: @currentCount</p> | |
<div class="form-group"> | |
<button id="counterClick" class="btn btn-primary counterClickC" @onclick="IncrementCount">Click me</button> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function initializeCounterComponent(container) { | |
var boton = container.querySelector("#counterClick"); | |
var title = container.querySelector("h1"); | |
if (boton) { | |
boton.addEventListener("click", (e) => { | |
console.log("click JavaScript"); | |
let button = e.target; | |
button.innerHTML = "Hello"; | |
title.innerHTML = "The button has been clicked!"; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@page "/counter" | |
@inject IJSRuntime js | |
<div @ref="container"> | |
<h1>Counter</h1> | |
<p>Current count: @currentCount</p> | |
<button id="counterClick" class="btn btn-primary counterClickC" @onclick="IncrementCount">Click me</button> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button @ref="myButton" id="counterClick" class="btn btn-primary counterClickC" @onclick="IncrementCount">Click me</button> | |
@code { | |
private ElementReference myButton; | |
protected async override Task OnAfterRenderAsync(bool firstRender) | |
{ | |
if (firstRender) | |
{ | |
await js.InvokeVoidAsync("initializeCounterComponent", myButton); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).on("click", "#counterClick", function (e) { | |
$(this).html("Hello"); | |
}); |