What is components in Angular2?

A class with a template and a decorator/metadata is called component. Lets make it more clear.

Template – It render the view of the application, in other way we can say it defines the user interface which contains the HTML, directives and bindings.

Class – It is same like AngularJS Controller. Class contains actual business logic (code) template. It is like a class in any other OOPS language like Java or C#. The class consist of functions and properties.

Decorator – Template hold by decorator. Its associate template with component. Its helps to decorate the class with extra information.

Now explaining it with an example.

1.  Write a small piece of code to understand each point .

import {Component} from “@angular/core”
@Component({
selector:”kris-app1″,
template:`<h1>Hi {{name}}</h1>`
})
export class AppComponent{
name: string = “Krishnangshu Banerjee”;
}

2. Then from console run ng serve -o and browser will open automatically and the output will be –

Continue reading “What is components in Angular2?”

How to stop infinite loop of MS Flow when SharePoint item modified

Recently I was developing a workflow using MS flow for my client. The basic requirement was to update SharePoint list. During development I was surprised because workflow was not stopping when updating a list item. It was getting into infinite loop. Then after lot of investigation I found that whenever updating an item the MS Flow ‘When an item is created or modified’ trigger again and it’s become never ending. Now the question is it possible to stop? Yes.

Let’s discuss the solution in details.

Step 1: Create a list and name it ‘FlowTest’ with column ‘Country’ and ‘First Letter’. Country is a drop-down column with values – Brazil, India, USA.

Step 2 :  Now Create a MS flow with same name as list name. The logic of the MS flow is when Country field value is ‘Brazil’ the flow will update ‘First Letter’ field value to ‘B’ otherwise ‘Unknown’.

Continue reading “How to stop infinite loop of MS Flow when SharePoint item modified”