Commit 77549f1c by Tuukka Kivilahti

inital test done

1 parent 252a284d
# MoyaAngular
# devausnoteja (tmp ohjeet)
`ng build --output-path=../moya-ear/target/moya-ear-1.2-SNAPSHOT/moya-web-1.2-SNAPSHOT.war/resources/angular-dist/`
# MoyaAngular, generoidut ohjeet
This project was generated with [angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.24.
......
......@@ -18,7 +18,8 @@
"prefix": "app",
"mobile": false,
"styles": [
"styles.css"
"styles.css",
"../node_modules/bootstrap/dist/css/bootstrap.min.css"
],
"scripts": [],
"environments": {
......
......@@ -21,7 +21,10 @@
"@angular/platform-browser": "^2.3.1",
"@angular/platform-browser-dynamic": "^2.3.1",
"@angular/router": "^3.3.1",
"bootstrap": "^4.0.0-alpha.6",
"core-js": "^2.4.1",
"ng2-bootstrap": "^1.3.3",
"node-sass": "^4.5.0",
"rxjs": "^5.0.1",
"ts-helpers": "^1.1.1",
"zone.js": "^0.7.2"
......@@ -39,9 +42,12 @@
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.2.1",
"node-sass": "^4.5.0",
"protractor": "~4.0.13",
"raw-loader": "^0.5.1",
"sass-loader": "^4.1.1",
"ts-node": "1.2.1",
"tslint": "^4.0.2",
"typescript": "~2.0.3"
"typescript": "~2.1.5"
}
}
......@@ -2,4 +2,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>moya-angular</artifactId>
<groupId>fi.codecrew.moya.angular</groupId>
<version>0.001</version>
</project>
<h1>
{{title}}
VIPLIST
</h1>
<moya-viplist>Loading viplist</moya-viplist>
......@@ -4,15 +4,21 @@ import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { AppComponent } from './app.component';
import { ViplistComponent } from './viplist/viplist.component';
import {AlertModule} from "ng2-bootstrap";
import {MoyaRestModule} from "./moya-rest/moya-rest.module";
@NgModule({
declarations: [
AppComponent
AppComponent,
ViplistComponent
],
imports: [
BrowserModule,
FormsModule,
HttpModule
HttpModule,
AlertModule.forRoot(),
MoyaRestModule.forRoot()
],
providers: [],
bootstrap: [AppComponent]
......
<table class="table table-striped table-hover">
<thead>
<tr>
<th>Description</th>
<th>shortdesc</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let vip of vips | async">
<td>{{vip.description}}</td>
<td>{{vip.shortdescr}}</td>
<td>
<div>
<div *ngFor="let p of vip.products">
<div style="display: inline-block;">{{p.name}}</div>
<div style="display: inline-block;">{{p.quantity}}</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
/* 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 { ViplistComponent } from './viplist.component';
describe('ViplistComponent', () => {
let component: ViplistComponent;
let fixture: ComponentFixture<ViplistComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ViplistComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ViplistComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import {ViplistService} from "../moya-rest/services/viplist.service";
import {Observable} from "rxjs";
import {Vip} from "../moya-rest/models/vip.model";
@Component({
selector: 'moya-viplist',
templateUrl: './viplist.component.html',
styleUrls: ['./viplist.component.css']
})
export class ViplistComponent implements OnInit {
vips : Observable<Array<Vip>>;
constructor(private viplistService : ViplistService) { }
ngOnInit() {
this.viplistService.get();
}
}
......@@ -102,7 +102,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<unpackTypes>war,ejb,jar</unpackTypes>
<unpackTypes>war,ejb</unpackTypes>
</configuration>
</plugin>
</plugins>
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<title></title>
</h:head>
<h:body>
<ui:composition template="#{sessionHandler.template}">
<ui:define name="headerdata">
<base href="/MoyaWeb/resources/angular-dist/"></base>
</ui:define>
<ui:define name="content">
<link rel="stylesheet" href="/MoyaWeb/resources/angular-dist/styles.bundle.css" />
<app-root>Lattaillaans</app-root>
<script type="text/javascript" src="/MoyaWeb/resources/angular-dist/inline.bundle.js"></script>
<script type="text/javascript" src="/MoyaWeb/resources/angular-dist/vendor.bundle.js"></script>
<script type="text/javascript" src="/MoyaWeb/resources/angular-dist/main.bundle.js"></script>
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!