1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

angular の勉強で一番困ったこと

Last updated at Posted at 2016-02-02

環境の設定については、あふれるほど記事があるのに、又サンプルも豊富に紹介されている。が、しかし肝心なことが、(私だけだと思いますが)ほとんど書かれていない。どうして?
例えば、angularの開発環境はgeneratorを使って簡単に作成できる。しかし次のような簡単なサンプルをgeneratorで作成したプロジェクトで実行するにはどいしたら良いのだろう?


<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.js"></script>
</head>
<body ng-app ng-init="name = 'World'">

    <h1>Hello, {{name}}!</h1>

</body>
</html>

app.JPG

上のサンプルをappにコピーしても動かない。

どうしたら動いたのか##

以前にCordova環境でangularとの組み合わせでthreejsなどをを動かしたことがある。
実はこのサンプルがgenerator-angular-cordovaやgenerator-angularですんなりと動いた。

そこでいったんCordovaで開発し、yeomanに持ってきて動かした次第である。

なぜそのようなことができるのか、appは独自で動いているのか、app以外はどのような役割をもっているのか?

現時点では不明。

1
2
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
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?