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
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
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
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
<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
<h1>Todo </h1> | |
<p>This component is to run todo app.</p> | |
<p *ngIf="!todos"><em>Loading...</em></p> | |
<div class="col-md-3 input-group"> | |
<!-- <label>New todo | |
</label> --> | |
<input [(ngModel)]="todo.title" class="form-control" placeholder="New todo title."> | |
<span class="input-group-btn"> |
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
using System.Collections.Generic; | |
using Microsoft.AspNetCore.Mvc; | |
using TodoNetCoreAngular.Models; | |
namespace TodoNetCoreAngular.Controllers | |
{ | |
[Route("api/[controller]")] | |
public class TodoController : Controller | |
{ |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.AspNetCore.SpaServices.Webpack; | |
using Microsoft.EntityFrameworkCore; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection; |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Microsoft.EntityFrameworkCore; | |
namespace TodoNetCoreAngular.Models | |
{ | |
public class TodoRepository | |
{ | |
private readonly TodoDbContext context; |