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
@{ | |
ViewBag.Title = "MVC"; | |
} | |
<mvc> | |
<blockquote *ngIf="message">{{message}}</blockquote> | |
</mvc> |
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
@{ | |
ViewBag.Title = "API"; | |
} | |
<numbers> | |
<style> | |
.grey-border { | |
margin-top: 20px; | |
padding: 10px; | |
-webkit-box-shadow: 0 0 15px #999; | |
box-shadow: 0 0 15px #999; |
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.AspNet.Mvc; | |
namespace WebApplication1.Controllers | |
{ | |
public class PartialController : Controller | |
{ | |
public IActionResult Message() => PartialView(); | |
public IActionResult Numbers() => PartialView(); | |
} |
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
import {Component, OnInit} from "angular2/core"; | |
import {CORE_DIRECTIVES} from "angular2/src/common/directives/core_directives"; | |
import {ApiService} from "./api.service"; | |
@Component({ | |
selector: "numbers", | |
templateUrl: "/partial/numbers", | |
providers: [ApiService], | |
directives: CORE_DIRECTIVES | |
}) |
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
import "rxjs/Rx" | |
import {Http} from "angular2/http"; | |
import {Injectable} from "angular2/core"; | |
@Injectable() | |
export class ApiService { | |
constructor(private http: Http) { } | |
get(onNext: (json: any) => void) { | |
this.http.get("api/random").map(response => response.json()).subscribe(onNext); |
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 System; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Microsoft.AspNet.Mvc; | |
namespace WebApplication1.Controllers | |
{ | |
[Route("api/[controller]")] | |
public class RandomController : Controller | |
{ |
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 WebApplication1 | |
@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers" |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>@ViewData["Title"]</title> | |
<environment names="Development"> | |
<!-- Css --> | |
<link rel="stylesheet" asp-href-include="~/css/*.css"> |
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
@{ | |
ViewData["Title"] = "Angular 2"; | |
} | |
<app class="container" style="display: block;">Loading...</app> |
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
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddGlimpse(); | |
services.AddMvc(); | |
} |