Skip to content

Instantly share code, notes, and snippets.

View jorgeucano's full-sized avatar

Jorge Cano jorgeucano

View GitHub Profile
@jorgeucano
jorgeucano / app.componentWithoutClass.ts
Last active May 2, 2016 14:13
Entendiendo el componente en angular2
@Component({
selector:'hello-world',
template: `
<div>
Hello World!
</div>
`
})
@jorgeucano
jorgeucano / app.component.ts
Created May 2, 2016 14:15
Entendiendo el componente en angular2
@Component({
selector:'hello-world',
template: `
<div>
<h1>Hello {{name}}!</h1>
</div>
`
})
class HelloWorld{
@jorgeucano
jorgeucano / user.ts
Created July 6, 2016 02:52
app/shared/user/user.ts
export class user {
email: string;
password: string;
}
@jorgeucano
jorgeucano / app.component.ts
Created July 6, 2016 02:58
importar en componente
import { User } from "./shared/user/user";
@jorgeucano
jorgeucano / app.component.ts
Created July 6, 2016 03:01
cambio la definicion de app.component.ts
export class AppComponent{
user: User;
isLoggingIn = true;
constructor(){
this.user = new User();
}
submit():void{
alert("esta el mail: " + this.user.email);
}
@jorgeucano
jorgeucano / app.component.ts
Created July 6, 2016 03:04
cambio el textfield por la instancia del componente
<TextField hint="Email Address" keyboardType="email" [(ngModel)]="user.email"
autocorrect="false" autocapitalizationType="none"></TextField>
<TextField hint="Password" [(ngModel)]="user.password" secure="true"></TextField>
@jorgeucano
jorgeucano / login.html
Created July 6, 2016 03:06
app/pages/login/login.html
<StackLayout>
<Image src="res://logo_login" stretch="none" horizontalAlignment="center"></Image>
<TextField hint="Email Address" keyboardType="email" [(ngModel)]="user.email"
autocorrect="false" autocapitalizationType="none"></TextField>
<TextField hint="Password" [(ngModel)]="user.password" secure="true"></TextField>
<Button [text]="isLoggingIn ? 'Sign in' : 'Sign up'" class="submit-button" (tap)="submit()"></Button>
<Button [text]="isLoggingIn ? 'Sign up' : 'Back to login'" (tap)="toggleDisplay()"></Button>
</StackLayout>
@jorgeucano
jorgeucano / app.component.ts
Created July 6, 2016 03:07
app componente final
import {Component} from "@angular/core";
import { User } from "./shared/user/user";
@Component({
selector: "my-app",
templateUrl: 'pages/login/login.html',
styleUrls: ["pages/login/login-common.css", "pages/login/login.css"]
})
export class AppComponent{
user: User;
isLoggingIn = true;
var a = 5;
var b = 10;
var c = a + b;
a = 10;
if (c == 20 ) // false
var a = 5;
var b = 10;
var c = a + b;
var a = 10;
if (c == 20) // true