Carlos Rojas
I teach the world to make Apps with #Angular, #Ionic and #Nativescript through Startupers Academy Conference Speaker and Google Product Strategy Expert
class Person {
name;
age;
constructor (name, age) {
this.name = name;
this.age = age;
}
getName(){
return this.name;
}
}
// lib/math.js
export function multiply (x, y) { return x * y }
// someApp.js
import { multiply } from "./lib/math"
console.log(multiply(2, 2));
doSomething(){
return new Promise((resolve) =>{
resolve(true);
})
}
doSomething().then(rta => {
console.log(rta);
});
// Only string permitted.
let alert = (msg: string) => {
alert(msg);
}
interface Shoe {
brand: string,
size: number,
isCasual: boolean
}
@Component({
selector: 'main-view',
styles: [ require('./main.view.scss') ],
template: require('./main.view.html'),
directives: [ UserInfoComponent ],
providers: [ PostService ]
})
export class MainViewComponent {
title: string = "Main View"
posts: Array<string> = []
constructor( private postService: PostService) {
this.postService.getPosts().then(posts => this.posts = posts)
}}
<div>{{ name }}</div>
<button (click)="downloadData()"> Download </button>
<ul>
<li *ngFor="let post of posts">
{{ post.name }}
</li> </ul>
<div *ngIf="shouldShow()">.....</div>
<user-info [user]="user"></user-info>
<input [(ngModel)]="username">
const observable = Observable.of('dog')
const subscriber = observable.subscribe(response => {
console.debug(response) }) subscriber.next('cat')
subscriber.unsubscribe()
@Injectable()
export class UserService {
baseUrl: string = 'http://api.myapp.com'
constructor(
@Inject(Http) private http: Http
) {}
downloadUser(): Observable<any> {
return this.http
.get(`${this.baseUrl}/user`)
.catch(() => Observable.throw())
.map(response => {
if (response.statusCode === 200) {
return response.json()
} else {
throw new Error()
}})}}
$npm install -g angular-cli
$ng new myapp
$ng build --prod
$ng serve
$npm install -g firebase
$firebase init
$firebase deploy
By Carlos Rojas
Hi, I'm Carlos. Angular 2 or simply Angular is the new powerful platform to develop web and mobile apps. In this slides i'm gonna show you an overview about Angular and this new release.
I teach the world to make Apps with #Angular, #Ionic and #Nativescript through Startupers Academy Conference Speaker and Google Product Strategy Expert