Wednesday, September 29, 2021

JBoss 7 EAP windows admin console

 1. Run add-user.bat

select a, Management User (mgmt-users.properties under standalone and domain will be updated)

provide the username and password

group: admin

no AS process

2. Run standalone.bat

verify there's no error in the dos window

3. http://127.0.0.1:9990/console

Input the username/password

Test connection for ExampleDS

4. Double click jboss-cli.bat

connect

version

deployment-info

5. standalone.bat -c standalone-full-ha.xml

Tuesday, September 28, 2021

Learning Angular third edition chapter 2 note

 Chapter 2 Introduction to TypeScript

1.

var brand: string = 'Chevrolet';

var message: string = `Today it's a happy day! I just bought a new ${brand} car`;

no more var; use the let keyword wherever possible.

The const keyword is a way to indicate that a variable should never change.

const brand: string[] = ['Chevrolet', 'Ford', 'General Motors'];

The null and undefined literals require special treatment. In a nutshell, they are typed under the any type, 

which makes it possible to assign these literals to any other variable, regardless of its original type.

2. custom types

type Animal = 'Cheetah' | 'Lion';

const animal: Animal = 'Cheetah';

enum Brands { Chevrolet, Cadillac, Ford, Buick, Chrysler, Dodge };

const myCar: Brands = Brands.Cadillac;

3. fat arrow functions

const double = x => x * 2;

const add = (x, y) => x + y;

const addAndDouble = (x, y) => {

    const sum = x + y;

    return sum * 2;

}

4.

Class decorators is executed before the class gets instantiated. 

Friday, September 24, 2021

Learning Angular third edition chapter 1 note

1. source code

https://github.com/PacktPublishing/Learning-Angular--Third-Edition

2. Node

Node.js is a JavaScript runtime built on top of Chrome's v8 JavaScript engine.

node -v

Npm is a software package manager that is included by default in Node.js. 

npm -v

npm install -g @angular/cli@10.0.0

ng version

3.

ng new my-app

ng serve

http://localhost:4200

app.component.ts is the landing page and the main component of the application.

Each web application has a main HTML file. For an Angular application, this is the index.html file

When the Angular CLI finds a tag that is not a known HTML element, such as app-root, it starts searching 

through the components of the application tree. 

Angular organizes components into self-contained blocks of functionality called modules. An Angular application 

has at least one main module called AppModule, as a convention.

Angular components should be registered with a module so that they are discoverable by the framework.

The declarations property is the place where we define all components that exist inside a module.

As soon as the application knows about all of the available components that it can search, it needs to identify 

which element tag belongs to which component. That is, it needs to find a way to match the tag with a component.

Angular matches HTML tags with components via a selector. It is the name that you give to a component so that it 

is correctly identified in HTML:

selector: 'app-root'

<span>{{ title }} app is running!</span>


The {{ }} syntax is one example of the Angular template language, called interpolation. It reads the title property 

of the component class, converts its value to text, and renders it on the screen.

4. main.ts

The starting point of an Angular application is always a module. The main task of the bootstrapping file is to 

define this module. It calls the bootstrapModule method of browser platform and passes AppModule as the entry point 

of the application.

5. Install VS Code extensions:

Angular Essentials

Angular Language Service

Angular Snippets (Type a-component inside the ts file and press Enter)

TSLint

6.

TSLint is a tool that performs static analysis of TypeScript code and enforces readability, maintainability, 

and error checking by applying a set of rules. These rules are defined in the tslint.json configuration file.

VS Code editor settings, such as indentation or spacing, can be set at a user or project level. EditorConfig can 

override these settings using a configuration file called .editorconfig