angular data attribute code example
Example 1: get all html element data using angular
File your-component-name.component.html
<input type="text" #inputbox>
<button type="submit" (click)="getelementData()">Show element data</button>
file your-component-name.component.ts
In the class make function named as
getelementData(nameinput){
console.log(nameinput);
console.log(nameinput.value);
}
Example 2: angular read element from html by atribute name
int number = 20;
Thread newThread = new Thread(() -> {
System.out.println("Factorial of " + number + " is: " + factorial(number));
});
newThread.start();
Example 3: angular read element from html by atribute name
CompletableFuture<Long> completableFuture = CompletableFuture.supplyAsync(() -> factorial(number));
while (!completableFuture.isDone()) {
System.out.println("CompletableFuture is not finished yet...");
}
long result = completableFuture.get();