A software component is a unit of composition with contractually specified interfaces and explicit context dependencies only.
Example of code; Hello world multi languages
Adrian Ferreres Esteller
github: ardiadrianadri
twitter: @ardiadrianadri
A) The component
B) The module
C) The app
The app context is the minimum set of code that we need to bootstrap the app
@Component({
selector: 'my-member',
templateUrl: './memeber.component.html',
styleUrls: ['./memeber.component.css']
})
export class MemberComponent {
@Input()
public member: Member = {
id: '',
title: '',
acceptButton: {
buttonClass: '',
buttonTitle: ''
},
rejectButton: {
buttonClass: '',
buttonTitle: ''
}
};
@Output()
public acceptEvent: EventEmitter<Member> = new EventEmitter<Member>();
@Output()
public rejectEvent: EventEmitter<Member> = new EventEmitter<Member>();
pressAccept() {
this.acceptEvent.emit(this.member);
}
pressReject() {
this.rejectEvent.emit(this.member);
}
}Redux architecture in Angular:
http://blog.ng-book.com/introduction-to-redux-with-typescript-and-angular-2/
On change event
Angular services
Angular pipe
Angular component
Back
Rest communication
Vertical
Horizontal way
@Injectable()
export class HeroesLikeService implements Reducer<Hero[]> {
private _addListHero (
state: Hero[],
action: ActionHeroLike
): Hero[] {
return state.concat(action.payload);
}
private _removeHero (
state: Hero[],
action: ActionHeroLike
): Hero[] {
return state.filter((element: Hero) =>
element.id !== action.payload[0].id);
}
reduce (state: Hero[], action: ActionHeroLike ): Hero[] {
let result: Hero [];
switch (action.type) {
case ActionsListLike.ADD_LIST:
result = this._addListHero(state,action);
break;
case ActionsListLike.ADD_HERO:
result = this._addListHero(state,action);
break;
case ActionsListLike.REMOVE_HERO:
result = this._removeHero(state, action);
break;
}
return result;
}
}Redux Service:
@Injectable()
export class HeroesLikeStore extends Store<Hero[]> {
constructor(
protected _reducer: HeroesLikeService,
@Inject(INITAL_STATE) private _initialState: Hero[],
private _errorManager: ErrorHeroesLike
){
super (_reducer, _initialState, _errorManager);
}
}Store:
@Injectable()
export class FilmService {
constructor(
@Inject(CONFIGURATION_FILMS) private _config: ConfigurationFilm,
private _http: Http
){}
private _mapResponseFilm(response:any): Film[]{
let data: any[] = response.json().results;
return data.map((element: any) => {
let film: Film = {
id: element.id,
title: element.title,
description: element.overview
}
return film;
});
}
getFilms(name: string): Observable<Film[]> {
let url=`${this._config.url}`;
return this._http.get(url)
.map(this._mapResponseFilm)
}
}Super heroes wiki
Open Software Madrid
To code a wiki of Marvel Superheroes using its public API
To code a web to search the most interesting projects of Open Software being made in Madrid
Bus tourist
ngChat
App to create tourist routes using the bus lines of the city
Chat coded in Angular for mobile, desktop and web. The main condition of this project is that, in a 80%, the code for all the different version has to be the same
ngPuzzle
ngModulator
To code a library in angular to make web sound
Javier Velez
Doctor en informática por la UNED desde el año 2009, Javier conjuga sus labores como profesor e investigador con la consultoría y la formación técnica para empresa. Su línea de trabajo actual se centra en la innovación y desarrollo de tecnologías para la Web. Además realiza actividades de evangelización y divulgación en diversas comunidades IT y es coordinador de varios grupos de ámbito local.
Twitter: @javiervelezreye
Felix Zapata
Desarrollador senior frontend en SyncRTC y consultor de accesibilidad web.