LoginSignup
2
0

More than 5 years have passed since last update.

[2日目] 初心者が作るアプリ開発 ~Typescriptを書くためにVimの準備とHelloWorld~

Posted at

[2日目] 初心者が作るアプリ開発 ~Typescriptを書くためにVimの準備とHelloWorld~

2日目(Vimの環境設定とHelloWorld表示)

まずは、Typescriptをいじるため、きちんとシンタックスハイライトしてもらわないと使いづらくてしょうがないです。

Neobundleでシンタックスハイライトのモジュールを入れちゃいましょう。

let g:syntastic_typescript_tsc_args = "--experimentalDecorators --target ES5"
NeoBundle 'leafgarland/typescript-vim'

この2行を書けば次にVimを開いたときにインストールが走ります。

では、HelloWorldを表示させてみましょう。

HelloWorldを書く

まずは前に作ったプロジェクト構成を見てみます。

▸ hooks/                       
▸ node_modules/                
▸ platforms/                   
▸ plugins/                     
▸ resources/                   
▾ src/                         
  ▾ app/                       
      app.component.ts         
      app.html                 
      app.module.ts            
      app.scss                 
      main.ts                  
  ▾ assets/                    
    ▾ icon/                    
        favicon.ico            
  ▾ pages/                     
    ▾ about/                   
        about.html             
        about.scss             
        about.ts
    ▾ contact/
        contact.html
        contact.scss
        contact.ts
    ▾ home/
        home.html
        home.scss
        home.ts
    ▾ tabs/
        tabs.html
        tabs.ts
  ▾ theme/
      variables.scss
    index.html
    manifest.json
    service-worker.js
▸ www/
  config.xml
  ionic.config.json
  package-lock.json
  package.json
  README.md
  tsconfig.json
  tslint.json

こんな感じです。

スクリーンショット 2017-06-10 14.57.09.png

これの下にあるアイコン勢が「about」「contact」「Home」のそれぞれのページを構成しているっぽいですね。

では、HomeにHelloWorldを追加してみます。

src/pages/home/home.html
<ion-header>
  <ion-navbar>
    <ion-title>Home</ion-title>
  </ion-navbar>
</ion-header>

<ion-content padding>
  <h2>Hello World</h2>
  <p> 
    hello hello
  </p>
</ion-content> 

スクリーンショット 2017-06-10 23.19.20.png

うん!いい感じです!
では、次から実際にアプリを作る段階に入っていきます。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0