From dce4e644d5e5d9c97ff5ac337448b52f2a2a64fd Mon Sep 17 00:00:00 2001 From: TAMARA JERINIC Date: Wed, 2 Mar 2022 23:38:27 +0100 Subject: Merge branch 'dev' of http://gitlab.pmf.kg.ac.rs/igrannonica/neuronstellar into Tamara # Conflicts: # .gitignore --- .../Front/src/app/app-routing.module.ts | 10 ++++ .../testAppNevena/Front/src/app/app.component.css | 0 .../testAppNevena/Front/src/app/app.component.html | 19 ++++++++ .../Front/src/app/app.component.spec.ts | 35 ++++++++++++++ .../testAppNevena/Front/src/app/app.component.ts | 28 +++++++++++ sandbox/testAppNevena/Front/src/app/app.module.ts | 23 +++++++++ .../Front/src/app/serve1.service.spec.ts | 16 +++++++ .../testAppNevena/Front/src/app/serve1.service.ts | 21 ++++++++ sandbox/testAppNevena/Front/src/assets/.gitkeep | 0 .../Front/src/environments/environment.prod.ts | 3 ++ .../Front/src/environments/environment.ts | 16 +++++++ sandbox/testAppNevena/Front/src/favicon.ico | Bin 0 -> 948 bytes sandbox/testAppNevena/Front/src/index.html | 13 +++++ sandbox/testAppNevena/Front/src/main.ts | 12 +++++ sandbox/testAppNevena/Front/src/polyfills.ts | 53 +++++++++++++++++++++ sandbox/testAppNevena/Front/src/styles.css | 1 + sandbox/testAppNevena/Front/src/test.ts | 26 ++++++++++ 17 files changed, 276 insertions(+) create mode 100644 sandbox/testAppNevena/Front/src/app/app-routing.module.ts create mode 100644 sandbox/testAppNevena/Front/src/app/app.component.css create mode 100644 sandbox/testAppNevena/Front/src/app/app.component.html create mode 100644 sandbox/testAppNevena/Front/src/app/app.component.spec.ts create mode 100644 sandbox/testAppNevena/Front/src/app/app.component.ts create mode 100644 sandbox/testAppNevena/Front/src/app/app.module.ts create mode 100644 sandbox/testAppNevena/Front/src/app/serve1.service.spec.ts create mode 100644 sandbox/testAppNevena/Front/src/app/serve1.service.ts create mode 100644 sandbox/testAppNevena/Front/src/assets/.gitkeep create mode 100644 sandbox/testAppNevena/Front/src/environments/environment.prod.ts create mode 100644 sandbox/testAppNevena/Front/src/environments/environment.ts create mode 100644 sandbox/testAppNevena/Front/src/favicon.ico create mode 100644 sandbox/testAppNevena/Front/src/index.html create mode 100644 sandbox/testAppNevena/Front/src/main.ts create mode 100644 sandbox/testAppNevena/Front/src/polyfills.ts create mode 100644 sandbox/testAppNevena/Front/src/styles.css create mode 100644 sandbox/testAppNevena/Front/src/test.ts (limited to 'sandbox/testAppNevena/Front/src') diff --git a/sandbox/testAppNevena/Front/src/app/app-routing.module.ts b/sandbox/testAppNevena/Front/src/app/app-routing.module.ts new file mode 100644 index 00000000..02972627 --- /dev/null +++ b/sandbox/testAppNevena/Front/src/app/app-routing.module.ts @@ -0,0 +1,10 @@ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; + +const routes: Routes = []; + +@NgModule({ + imports: [RouterModule.forRoot(routes)], + exports: [RouterModule] +}) +export class AppRoutingModule { } diff --git a/sandbox/testAppNevena/Front/src/app/app.component.css b/sandbox/testAppNevena/Front/src/app/app.component.css new file mode 100644 index 00000000..e69de29b diff --git a/sandbox/testAppNevena/Front/src/app/app.component.html b/sandbox/testAppNevena/Front/src/app/app.component.html new file mode 100644 index 00000000..1b8ab205 --- /dev/null +++ b/sandbox/testAppNevena/Front/src/app/app.component.html @@ -0,0 +1,19 @@ + +
+ +
+ +
+
+ +
+ +
+ + + +
+ Rezultat je: {{Sum}} +
\ No newline at end of file diff --git a/sandbox/testAppNevena/Front/src/app/app.component.spec.ts b/sandbox/testAppNevena/Front/src/app/app.component.spec.ts new file mode 100644 index 00000000..1f0da84c --- /dev/null +++ b/sandbox/testAppNevena/Front/src/app/app.component.spec.ts @@ -0,0 +1,35 @@ +import { TestBed } from '@angular/core/testing'; +import { RouterTestingModule } from '@angular/router/testing'; +import { AppComponent } from './app.component'; + +describe('AppComponent', () => { + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [ + RouterTestingModule + ], + declarations: [ + AppComponent + ], + }).compileComponents(); + }); + + it('should create the app', () => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.componentInstance; + expect(app).toBeTruthy(); + }); + + it(`should have as title 'project'`, () => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.componentInstance; + expect(app.title).toEqual('project'); + }); + + it('should render title', () => { + const fixture = TestBed.createComponent(AppComponent); + fixture.detectChanges(); + const compiled = fixture.nativeElement as HTMLElement; + expect(compiled.querySelector('.content span')?.textContent).toContain('project app is running!'); + }); +}); diff --git a/sandbox/testAppNevena/Front/src/app/app.component.ts b/sandbox/testAppNevena/Front/src/app/app.component.ts new file mode 100644 index 00000000..6e66e308 --- /dev/null +++ b/sandbox/testAppNevena/Front/src/app/app.component.ts @@ -0,0 +1,28 @@ +import { Component } from '@angular/core'; +import { NgModel } from '@angular/forms'; +import { Router } from '@angular/router'; +import { Serve1Service } from './serve1.service';// + +@Component({ + selector: 'app-root', + templateUrl: './app.component.html', + styleUrls: ['./app.component.css'] +}) +export class AppComponent { + title = 'project'; + a = 0; + b = 0; + Sum = ""; + + + constructor(private serve1: Serve1Service, private router: Router) { } // + + sumNumbers() { + console.log(this.a + ':' + this.b); + // za slanje back-u, subscribe - asinhrono + this.serve1.sendNumbers(this.a, this.b).subscribe((serviceSum) => { + console.log(serviceSum); + this.Sum = serviceSum; + }) + } +} \ No newline at end of file diff --git a/sandbox/testAppNevena/Front/src/app/app.module.ts b/sandbox/testAppNevena/Front/src/app/app.module.ts new file mode 100644 index 00000000..03cf5bf5 --- /dev/null +++ b/sandbox/testAppNevena/Front/src/app/app.module.ts @@ -0,0 +1,23 @@ +import { NgModule } from '@angular/core'; +import { BrowserModule } from '@angular/platform-browser'; +import {HttpClientModule} from '@angular/common/http'; // +import { AppRoutingModule } from './app-routing.module'; +import { AppComponent } from './app.component'; +import { FormsModule } from '@angular/forms'; + +@NgModule({ + declarations: [ + AppComponent + ], + imports: [ + BrowserModule, + AppRoutingModule, + FormsModule, + HttpClientModule// + ], + providers: [], + bootstrap: [AppComponent] +}) +export class AppModule { + +} diff --git a/sandbox/testAppNevena/Front/src/app/serve1.service.spec.ts b/sandbox/testAppNevena/Front/src/app/serve1.service.spec.ts new file mode 100644 index 00000000..8c248f44 --- /dev/null +++ b/sandbox/testAppNevena/Front/src/app/serve1.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { Serve1Service } from './serve1.service'; + +describe('Serve1Service', () => { + let service: Serve1Service; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(Serve1Service); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/sandbox/testAppNevena/Front/src/app/serve1.service.ts b/sandbox/testAppNevena/Front/src/app/serve1.service.ts new file mode 100644 index 00000000..a35733a9 --- /dev/null +++ b/sandbox/testAppNevena/Front/src/app/serve1.service.ts @@ -0,0 +1,21 @@ +import { Injectable } from '@angular/core'; +import { HttpClient, HttpHeaders } from '@angular/common/http'; + +@Injectable({ + providedIn: 'root' +}) +export class Serve1Service { + + constructor(private http: HttpClient) { } + + /*getNumbers() { + return this.http.get(`http://localhost:5000/api/kontroler/`); + }*/ + + sendNumbers(a: number, b: number) { + let header: HttpHeaders = new HttpHeaders({ + 'Content-type': 'application/json', + }); + return this.http.post(`http://localhost:5000/api/kontroler/`, {a, b }, { headers: header, responseType: 'text' }); + } +} diff --git a/sandbox/testAppNevena/Front/src/assets/.gitkeep b/sandbox/testAppNevena/Front/src/assets/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/sandbox/testAppNevena/Front/src/environments/environment.prod.ts b/sandbox/testAppNevena/Front/src/environments/environment.prod.ts new file mode 100644 index 00000000..3612073b --- /dev/null +++ b/sandbox/testAppNevena/Front/src/environments/environment.prod.ts @@ -0,0 +1,3 @@ +export const environment = { + production: true +}; diff --git a/sandbox/testAppNevena/Front/src/environments/environment.ts b/sandbox/testAppNevena/Front/src/environments/environment.ts new file mode 100644 index 00000000..f56ff470 --- /dev/null +++ b/sandbox/testAppNevena/Front/src/environments/environment.ts @@ -0,0 +1,16 @@ +// This file can be replaced during build by using the `fileReplacements` array. +// `ng build` replaces `environment.ts` with `environment.prod.ts`. +// The list of file replacements can be found in `angular.json`. + +export const environment = { + production: false +}; + +/* + * For easier debugging in development mode, you can import the following file + * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. + * + * This import should be commented out in production mode because it will have a negative impact + * on performance if an error is thrown. + */ +// import 'zone.js/plugins/zone-error'; // Included with Angular CLI. diff --git a/sandbox/testAppNevena/Front/src/favicon.ico b/sandbox/testAppNevena/Front/src/favicon.ico new file mode 100644 index 00000000..997406ad Binary files /dev/null and b/sandbox/testAppNevena/Front/src/favicon.ico differ diff --git a/sandbox/testAppNevena/Front/src/index.html b/sandbox/testAppNevena/Front/src/index.html new file mode 100644 index 00000000..e67e59a2 --- /dev/null +++ b/sandbox/testAppNevena/Front/src/index.html @@ -0,0 +1,13 @@ + + + + + Project + + + + + + + + diff --git a/sandbox/testAppNevena/Front/src/main.ts b/sandbox/testAppNevena/Front/src/main.ts new file mode 100644 index 00000000..c7b673cf --- /dev/null +++ b/sandbox/testAppNevena/Front/src/main.ts @@ -0,0 +1,12 @@ +import { enableProdMode } from '@angular/core'; +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; + +import { AppModule } from './app/app.module'; +import { environment } from './environments/environment'; + +if (environment.production) { + enableProdMode(); +} + +platformBrowserDynamic().bootstrapModule(AppModule) + .catch(err => console.error(err)); diff --git a/sandbox/testAppNevena/Front/src/polyfills.ts b/sandbox/testAppNevena/Front/src/polyfills.ts new file mode 100644 index 00000000..429bb9ef --- /dev/null +++ b/sandbox/testAppNevena/Front/src/polyfills.ts @@ -0,0 +1,53 @@ +/** + * This file includes polyfills needed by Angular and is loaded before the app. + * You can add your own extra polyfills to this file. + * + * This file is divided into 2 sections: + * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. + * 2. Application imports. Files imported after ZoneJS that should be loaded before your main + * file. + * + * The current setup is for so-called "evergreen" browsers; the last versions of browsers that + * automatically update themselves. This includes recent versions of Safari, Chrome (including + * Opera), Edge on the desktop, and iOS and Chrome on mobile. + * + * Learn more in https://angular.io/guide/browser-support + */ + +/*************************************************************************************************** + * BROWSER POLYFILLS + */ + +/** + * By default, zone.js will patch all possible macroTask and DomEvents + * user can disable parts of macroTask/DomEvents patch by setting following flags + * because those flags need to be set before `zone.js` being loaded, and webpack + * will put import in the top of bundle, so user need to create a separate file + * in this directory (for example: zone-flags.ts), and put the following flags + * into that file, and then add the following code before importing zone.js. + * import './zone-flags'; + * + * The flags allowed in zone-flags.ts are listed here. + * + * The following flags will work for all browsers. + * + * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame + * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick + * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames + * + * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js + * with the following flag, it will bypass `zone.js` patch for IE/Edge + * + * (window as any).__Zone_enable_cross_context_check = true; + * + */ + +/*************************************************************************************************** + * Zone JS is required by default for Angular itself. + */ +import 'zone.js'; // Included with Angular CLI. + + +/*************************************************************************************************** + * APPLICATION IMPORTS + */ diff --git a/sandbox/testAppNevena/Front/src/styles.css b/sandbox/testAppNevena/Front/src/styles.css new file mode 100644 index 00000000..90d4ee00 --- /dev/null +++ b/sandbox/testAppNevena/Front/src/styles.css @@ -0,0 +1 @@ +/* You can add global styles to this file, and also import other style files */ diff --git a/sandbox/testAppNevena/Front/src/test.ts b/sandbox/testAppNevena/Front/src/test.ts new file mode 100644 index 00000000..00025daf --- /dev/null +++ b/sandbox/testAppNevena/Front/src/test.ts @@ -0,0 +1,26 @@ +// This file is required by karma.conf.js and loads recursively all the .spec and framework files + +import 'zone.js/testing'; +import { getTestBed } from '@angular/core/testing'; +import { + BrowserDynamicTestingModule, + platformBrowserDynamicTesting +} from '@angular/platform-browser-dynamic/testing'; + +declare const require: { + context(path: string, deep?: boolean, filter?: RegExp): { + (id: string): T; + keys(): string[]; + }; +}; + +// First, initialize the Angular testing environment. +getTestBed().initTestEnvironment( + BrowserDynamicTestingModule, + platformBrowserDynamicTesting(), +); + +// Then we find all the tests. +const context = require.context('./', true, /\.spec\.ts$/); +// And load the modules. +context.keys().map(context); -- cgit v1.2.3