...want to know the purpose why we are declaring it in below way...
Those are property declarations with initializers. The resulting properties will exist on instances of the class (and will be public, just as though they had public in front of them).
...and why we are not using type declartion here of typescript...
TypeScript will infer the types from the initialization values (more in the documentation). If you're initializing something when you're defining it, you often don't need to explicitly provide the type.
That said, there should be a type for serverElements since it will end up being never[] (in an up-to-date version of TypeScript), which probably isn't what the author wanted. For instance, if it was supposed to be an array of ServerElement instances:
export class AppComponent {
serverElements: ServerElement[] = [];
newServerName = '';
newServerContent = '';
}
newServerName and newServerContent are both inferred as string, which is reasonable.