Skip to content

Instantly share code, notes, and snippets.

View IEvangelist's full-sized avatar
:octocat:
Coding for a better world 🤓

David Pine IEvangelist

:octocat:
Coding for a better world 🤓
View GitHub Profile
{
"version": "1.0.0-*",
"compilationOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.AspNet.Authentication.Cookies": "1.0.0-rc1-final",
"Microsoft.AspNet.Diagnostics.Entity": "7.0.0-rc1-final",
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
import {bootstrap} from "angular2/platform/browser"
import {ROUTER_PROVIDERS} from "angular2/router";
import {HTTP_PROVIDERS} from "angular2/http";
import {AppComponent} from "./app.component"
bootstrap(AppComponent, [ROUTER_PROVIDERS, HTTP_PROVIDERS]);
import {Component, OnInit} from "angular2/core";
@Component({
selector: "static",
templateUrl: "app/components/static.html"
})
export class StaticComponent implements OnInit {
message: string;
constructor() { }
<static>
<blockquote>{{message}}</blockquote>
</static>
<div class="page-header">
<h1>
MVC, Angular2
<br>
<small>Sample</small>
</h1>
</div>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
import {Component, OnInit} from "angular2/core";
@Component({
selector: "mvc",
templateUrl: "/partial/message"
})
export class MvcComponent implements OnInit {
message: string;
constructor() { }
@{
ViewBag.Title = "MVC";
}
<mvc>
<blockquote *ngIf="message">{{message}}</blockquote>
</mvc>
@{
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;
using Microsoft.AspNet.Mvc;
namespace WebApplication1.Controllers
{
public class PartialController : Controller
{
public IActionResult Message() => PartialView();
public IActionResult Numbers() => PartialView();
}
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
})