スキップしてメイン コンテンツに移動

投稿

11月, 2019の投稿を表示しています

Create pages with Angular 2

Create pages with Angular Create pages with Angular 1 Create child components I could add a child component to top-page component like below. ng g component top-page/product-ranking product-ranking folder was made under the top-page folder. src L app L top-page L product-ranking L product-ranking.component.css ... Base size I thought, the important thing was the base size of component was affected by the parent component. Although there had been some parent elements, the child component's size ignored them. For example, I generated two components on the same directory, and made parent-child relationship by HTML template. src L app L top-page L product-ranking // component L product-ranking-block // component L product-cell // component product-ranking.component.html <div id="product-ranking-area"> <div id="product-ranking-frame"> <div id=&

Create pages with Angular 1

What I did I created some pages with Angular. Because I wanted to use on my work, I had to add compatibility of IE11. The structure of pages Top page L Page1 L Page2 L Contents1 L Contents2 * Contents1 and Contents2 were shown and hidden by URL parameter. Setup Environments npm : ver.6.13.1 Angular : ver.8.2.14 Angular-cli : ver.8.3.19 VSCode : ver.1.41.0-insider Create project ng new product-sample I didn't add router, and I choosed CSS. Read configuration file Angular How-to: Editable Config Files - Premier Developer First, I added config file. Most of all things I did were written in the blog. First, I tried using DI and calling load method in AppConfig's constructor. But when I had done like that, I couldn't use in the class constructors and ngOnInits what had been depended on AppConfig. Because at that time, the loading had not been finished yet, so I could get undefined. app-config.service.ts (failed) import {

[ASP.NET Core 3.0] Sign in with Identity

Today I tried authentication by ASP.NET Core Identity. What I did 1. Create custom IdentityUser 2. Create a route for authentication 3. After authentication, access authorized route Setup Most of all environments were same as previous post. I only installed Microsoft.AspNetCore.Identity.EntityFrameworkCore (ver.3.0.0) by NuGet. Add user table I added user table to DB. CREATE TABLE "User" ( "UserId" serial PRIMARY KEY, "Name" text not null, "Password" text not null ) 1. Create custom IdentityUser First, I created custom IdentityUser for signing in. Because the default IdentityUser had had so many properties. But I only wanted three things below. Id UserName Password ApplicationUser I could created custom user class by inheritting IdentityUser class. ApplicationUser.cs using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Microsoft.AspNetCore.Identity; names