Skip to content

Instantly share code, notes, and snippets.

View Nathan-Nesbitt's full-sized avatar

Nathan Nathan-Nesbitt

View GitHub Profile
@Nathan-Nesbitt
Nathan-Nesbitt / component-example.component-UPDATED.html
Created June 18, 2020 17:56
Updates the routing between the two components we created Angular NativeScript
<Button [nsRouterLink]="['/home']" text="component-example works! {{ value }}" class="btn btn-primary"></Button>
@Nathan-Nesbitt
Nathan-Nesbitt / component-example.component-UPDATED.html
Created June 18, 2020 17:50
Changes to display the Service value inside the component
<Button text="component-example works! {{ value }}" class="btn btn-primary"></Button>
@Nathan-Nesbitt
Nathan-Nesbitt / Use-New-Service-Function.ts
Created June 18, 2020 17:47
Uses the newly created Service Function
import { Component, OnInit } from '@angular/core';
import { ExampleServiceService } from '../example-service.service';
@Component({
selector: 'app-component-example',
templateUrl: './component-example.component.html',
styleUrls: ['./component-example.component.css']
})
export class ComponentExampleComponent implements OnInit {
@Nathan-Nesbitt
Nathan-Nesbitt / Create-New-Service-Function.ts
Last active June 18, 2020 17:47
Creates a function for a service in Angular NativeScript
export class ExampleServiceService {
constructor() { }
public myTestFunction(...numbers: number[]): number {
// This is a simple function to add up some numbers //
let result = 0;
for (let val of numbers) {
@Nathan-Nesbitt
Nathan-Nesbitt / Create-Angular-NativeScript-Service.sh
Created June 18, 2020 17:43
Creates Angular NativeScript Service
ng generate service example-service
@Nathan-Nesbitt
Nathan-Nesbitt / app-routing.module-OLD.ts
Last active June 18, 2020 17:41
Changes to routing in Angular NativeScript Application to Redirect to Proper Page
import { HomeComponent } from './home/home.component';
const routes: Routes = [
{ path: '', redirectTo: '/home', pathMatch: 'full' },
{ path: 'home', component: HomeComponent },
];
@Nathan-Nesbitt
Nathan-Nesbitt / Changes-For-New-Component.ts
Created June 18, 2020 17:27
Changes to the app.module.ts file when you create a new Component in an Angular/NativeScript project
import { ComponentExampleComponent } from './component-example/component-example.component';
@Nathan-Nesbitt
Nathan-Nesbitt / Create-Angular-NativeScript-Component.sh
Created June 18, 2020 17:22
Creates an Angular Component in NativeScript
ng generate component component-example
@Nathan-Nesbitt
Nathan-Nesbitt / Create-Angular-NativeScript-Module.sh
Created June 18, 2020 17:12
Creates a Module for Angular called module-example
ng generate module module-example
@Nathan-Nesbitt
Nathan-Nesbitt / Create-NativeScript-Angular-Project.sh
Created June 18, 2020 17:07
Creates a new NativeScript project using Angular
ng new --collection=@nativescript/schematics test-application