Updated ng-app; Added eclipse settings

This commit is contained in:
francesco 2020-03-09 15:53:35 +01:00
parent ab934d8804
commit 0dfc403935
21 changed files with 235 additions and 8 deletions

49
.classpath Normal file
View File

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/target/

28
.project Normal file
View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>springboot-angular-app-demo-0.0.1-SNAPSHOT</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,5 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding/<project>=UTF-8

View File

@ -0,0 +1,2 @@
eclipse.preferences.version=1
org.eclipse.jdt.apt.aptEnabled=false

View File

@ -0,0 +1,10 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.processAnnotations=disabled
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8

View File

@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

View File

@ -0,0 +1,2 @@
eclipse.preferences.version=1
spring.boot.launch.profile.history=development;

View File

@ -0,0 +1,2 @@
boot.validation.initialized=true
eclipse.preferences.version=1

14
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,14 @@
{
"configurations": [
{
"type": "java",
"name": "Spring Boot-SpringbootAngularAppDemoApplication<springboot-angular-app-demo>",
"request": "launch",
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"mainClass": "org.gcube.app.springbootangulardemo.SpringbootAngularAppDemoApplication",
"projectName": "springboot-angular-app-demo",
"args": ""
}
]
}

View File

@ -2,7 +2,12 @@ import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
const routes: Routes = [];
import { MyFirstCAngularComponent } from './my-first-c-angular/my-first-c-angular.component';
const routes: Routes = [
//{path: '', component: HelloWorldComponent},
{path: '', component: MyFirstCAngularComponent},
];
@NgModule({
imports: [RouterModule.forRoot(routes)],

View File

@ -6,5 +6,5 @@ import { Component } from '@angular/core';
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'ng-app';
title = 'ng-app created by guide "Building a Web App using Spring Boot and Angular9-CLI with Maven"';
}

View File

@ -3,16 +3,25 @@ import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { MyFirstCAngularComponent } from './my-first-c-angular/my-first-c-angular.component';
import { HttpClientModule } from '@angular/common/http';
import { MyFirstSAngularService } from './service/my-first-s-angular.service';
@NgModule({
declarations: [
AppComponent
AppComponent,
MyFirstCAngularComponent
],
imports: [
BrowserModule,
AppRoutingModule
BrowserModule,
AppRoutingModule,
HttpClientModule
],
providers: [],
bootstrap: [AppComponent]
providers: [
MyFirstSAngularService
],
bootstrap: [
AppComponent
]
})
export class AppModule { }

View File

@ -0,0 +1,12 @@
/*
* This class is a model for mapping the Greeting.java
* provided by Spring
*/
export class MyFirstAngularGreetingModelClass {
id: number;
content: string;
constructor(private _id: number, public message: string) {
this.id = _id;
this.content = message;
}
}

View File

@ -0,0 +1,3 @@
<div class="container">
This is a message from server -> <h1>{{this.welcomeMessage}}</h1>
</div>

View File

@ -0,0 +1,28 @@
/* tslint:disable:no-unused-variable */
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { MyFirstCAngularComponent } from './my-first-c-angular.component';
describe('MyFirstCAngularComponent', () => {
let component: MyFirstCAngularComponent;
let fixture: ComponentFixture<MyFirstCAngularComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ MyFirstCAngularComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(MyFirstCAngularComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,22 @@
import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { MyFirstSAngularService } from '../service/my-first-s-angular.service';
@Component({
selector: 'app-my-first-c-angular',
templateUrl: './my-first-c-angular.component.html',
styleUrls: ['./my-first-c-angular.component.css']
})
export class MyFirstCAngularComponent implements OnInit {
welcomeMessage = '';
constructor(private myFirstAnguluarService: MyFirstSAngularService) { }
ngOnInit() {
this.myFirstAnguluarService.executeMyFirstHttpCall().subscribe((res) => {
this.welcomeMessage = res.content;
});
}
}

View File

@ -0,0 +1,16 @@
/* tslint:disable:no-unused-variable */
import { TestBed, async, inject } from '@angular/core/testing';
import { MyFirstSAngularService } from './my-first-s-angular.service';
describe('Service: MyFirstSAngular', () => {
beforeEach(() => {
TestBed.configureTestingModule({
providers: [MyFirstSAngularService]
});
});
it('should ...', inject([MyFirstSAngularService], (service: MyFirstSAngularService) => {
expect(service).toBeTruthy();
}));
});

View File

@ -0,0 +1,15 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { MyFirstAngularGreetingModelClass } from '../model/my-first-angular-greeting-model-class';
@Injectable({
providedIn: 'root'
})
export class MyFirstSAngularService {
constructor(private http: HttpClient) { }
executeMyFirstHttpCall() {
return this.http.get<MyFirstAngularGreetingModelClass>('http://localhost:8080/api/greeting-obj');
}
}

View File

@ -1,5 +1,5 @@
#Generated by Maven Integration for Eclipse
#Mon Mar 09 13:17:17 CET 2020
#Mon Mar 09 15:50:13 CET 2020
version=0.0.1-SNAPSHOT
groupId=org.gcube.app
m2e.projectName=springboot-angular-app-demo-0.0.1-SNAPSHOT