This file contains 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
<h1>Todo item {{ todo.id }} </h1> | |
<p>Edit item {{ todo.title }}.</p> | |
<p *ngIf="!todo"><em>Loading...</em></p> | |
<!-- <label>item: </label> --> | |
<div class="col-md-3 input-group"> | |
<input [(ngModel)]="todoitem.item" class="form-control " placeholder="new todo item"/> | |
<span class="input-group-btn"> | |
<button (click)="Additem()" class="btn btn-primary " >Add</button> |
This file contains 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 {Http, RequestOptionsArgs, RequestOptions, Headers} from "@angular/http"; | |
import { Component, Injectable, Inject } from "@angular/core"; | |
import { LoggerService } from "./logger.service"; | |
import { ITodo } from "../todo/todo.component"; | |
import { ITodoItem } from "../todoitem/todoitem.component"; | |
import { Subscription } from "rxjs/Subscription"; | |
import { IfObservable } from "rxjs/observable/IfObservable"; | |
@Injectable() | |
export class TodoService { |
This file contains 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
static void SerializeHttpClient(string resourceUrl) | |
{ | |
HttpClient client = new HttpClient(); | |
client.BaseAddress = new Uri("https://www.idx.co.id"); | |
client.DefaultRequestHeaders.Add(HttpRequestHeader.ContentType.ToString(), "application/json"); | |
var task = client.GetAsync(resourceUrl); | |
task.Wait(); | |
var response = task.Result; | |
if (response.StatusCode == HttpStatusCode.OK) |
This file contains 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
static void SerializeRestSharp(string resourceUrl) | |
{ | |
var client = new RestClient("https://www.idx.co.id"); | |
client.AddDefaultHeader(HttpRequestHeader.ContentType.ToString(), "application/json"); | |
var req = new RestRequest(resourceUrl, Method.GET); | |
var res = client.ExecuteAsGet(req, Method.GET.ToString());//, res => | |
if (res.IsSuccessful) | |
{ | |
var listingdata = JsonConvert.DeserializeObject<ListingData>((string)JToken.Parse(res.Content)); | |
System.Console.WriteLine("{0}-{1}", listingdata.Activities[0].KodeEmiten, listingdata.Activities[0].NamaEmiten); |
This file contains 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
<Grid > | |
<Grid.ColumnDefinitions> | |
<ColumnDefinition Width="1*"/> | |
</Grid.ColumnDefinitions> | |
<Grid.RowDefinitions> | |
<RowDefinition Height="2*" MaxHeight="200" ScrollViewer.VerticalScrollBarVisibility="Auto"/> | |
<RowDefinition Height="2*" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto"/> | |
</Grid.RowDefinitions> | |
This file contains 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 class ViewAViewModel : BindableBase | |
{ | |
private NewsService NewsService; | |
private NewsAnnouncement newsAnnouncement; | |
public NewsAnnouncement NewsAnnouncement | |
{ | |
get { return newsAnnouncement; } | |
set | |
{ |
This file contains 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 class ChatHub : Hub | |
{ | |
public void Send(string message) | |
{ | |
Clients.All.SendAsync("SendMessage", Context.User.Identity.Name, message); | |
} | |
public override async Task OnConnectedAsync(){ | |
await Clients.All.SendAsync("SendAction", Context.User.Identity.Name, "joined"); | |
} |
This file contains 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"] = "Chat"; | |
} | |
<h2>Chat</h2> | |
<div class="container"> | |
<form id="send-form" action="#"> | |
<div class="form-group"> | |
<label>Send a message:</label> | |
<div class="input-group"> |
This file contains 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
// This method gets called by the runtime. Use this method to add services to the container. | |
public void ConfigureServices(IServiceCollection services) | |
{ | |
/// | |
/// sesuai bawaan template project | |
/// | |
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme) | |
.AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, d => |