AndrewJBateman / angular-tutorial-app

:clipboard: Simple app to display a list of servers and indicate whether the server is on or offline. Created as part of Udemy Angular course.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

⚑ Angular Tutorial App

  • A simple Angular app to display a list of servers and indicate whether the server is on or offline.
  • Server names can be added to the list.
  • Note: to open web links in a new window use: ctrl+click on link

GitHub repo size GitHub pull requests GitHub Repo stars GitHub last commit

πŸ“„ Table of contents

πŸ“š General info

  • This course project is to help learn about basic Angular concepts, including using components, data & property binding, the formsmodule etc.

πŸ“· Screenshots

Example screenshot.

πŸ“Ά Technologies

πŸ’Ύ Setup

  • Install dependencies by running npm i
  • Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files
  • Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build

πŸ’» Code Examples

  • server component with functions used to generate html template data.
import { Component } from '@angular/core';

@Component({
  selector: 'app-server',
  templateUrl: './server.component.html',
  styles: [`
    .online {
      color: white;
    }
  `]
})
export class ServerComponent {
  serverId = 10;
  serverStatus = 'offline';

  // use a random number generator function to get a random status of on or offline
  constructor() {
  this.serverStatus = Math.random() > 0.5 ? 'online' : 'offline';
  }

  // function to return the random server status
  getServerStatus() {
    return this.serverStatus;
  }

  // function to show online status with a green background and offline with red.
  getColor() {
    return this.serverStatus === 'online' ? 'green' : 'red';
  }
}

πŸ†’ Features

  • Server names can be added via a form-control input field.
  • The background color of each server in the list changes depending on the online status of the server.

πŸ“‹ Status & To-Do List

  • Status: Working.
  • To-Do: Nothing

πŸ‘ Inspiration

πŸ“ License

  • This project is licensed under the terms of the MIT license.

βœ‰οΈ Contact

About

:clipboard: Simple app to display a list of servers and indicate whether the server is on or offline. Created as part of Udemy Angular course.

License:MIT License


Languages

Language:TypeScript 77.8%Language:HTML 11.7%Language:JavaScript 7.7%Language:CSS 2.8%