This is a pretty broad questions, since there are an infinite number of ways to do this. This article will give you a pretty good overview on getting started.
Most simply, you need to make a new file, with this content in it:
@Injectable()
export class AdminService {
getArray() {
return ['my array'];
}
}
You will need to include this service in your app modules in the providers section, and import it into your AdminForm component. Something along the lines of import { AdminService } from './AdminService'; should do the job.
You then should change your constructor to this:
constructor(private adminService: AdminService, adminName:String,adminEmail:String,adminPassword:String){
this.nameAd=adminName;
this.email_addr=adminEmail;
this.passwrd=adminPassword;
}
Which will then give you access to your admin service and you can get your array.
myArray;
constructor(private adminService: AdminService, adminName:String,adminEmail:String,adminPassword:String){
this.nameAd=adminName;
this.email_addr=adminEmail;
this.passwrd=adminPassword;
this.myArray = adminService.getArray();
}
This answer should get you started, but if you need more in-depth information about services, the link at the top of this answer should have all the information you need to get going.