On the same folder where you will download 'app.js', do these things
npm init -y
npm install --save express cors
npm install -g nodemon
package com.thelogbox; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.view.View.OnClickListener; | |
import android.content.Context; | |
import android.widget.LinearLayout; | |
import android.hardware.Camera; | |
import android.hardware.Camera.ShutterCallback; |
# update brew because `brew update` is broken after updating to El Capitan | |
cd `brew --prefix` | |
git fetch origin | |
git reset --hard origin/master | |
sudo shutdown -r now # restart the computer | |
# open terminal and run the following | |
brew update | |
brew cleanup |
On the root module (app.module.ts)
On the app.service.ts
In angular.json
<h1>{{ title }}</h1> | |
<button (click)="subscribe()"> | |
Subscribe | |
</button> |
To create the project | |
ng new parentchild | |
ng g c childone | |
cd parentchild | |
npm install --save bootstrap |
<h1>{{ title }}</h1> | |
<strong>Can you guess a number betwee 1 to 100?</strong> | |
<p> | |
<input placeholder="type an integer" [(ngModel)]="guess"> | |
</p> | |
<button (click)="guessTheNumber()"> | |
Guess the number | |
</button> | |
<p></p> |
class MainActivity : AppCompatActivity() { | |
val Log = Logger.getLogger(MainActivity::class.java.name) | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
} | |
override fun onCreateOptionsMenu(menu: Menu?): Boolean { | |
Log.info("onCreateOptionsMenu") |
// Warning, this code won't compile in Kotlin | |
// it has problemss. Can you spot which line won't compile? | |
fun main(args: Array<String>) { | |
val mlist = listOf(Programmer("Ted"), Tester("Steph")) // (1) | |
val mprogs = mlist.typeOf<Programmer>() // (2) | |
mprogs.forEach { // (3) | |
println("${it.toString()} : ${it.javaClass.simpleName}") | |
} |