码迷,mamicode.com
首页 > Web开发 > 详细

AngularJS - Map View

时间:2016-08-15 12:54:38      阅读:121      评论:0      收藏:0      [点我收藏+]

标签:

AngularJS is a JavaScirpt web framework amied to make web apps simple to build and easy to maintain.

 

Files

===================================================

CSS

  - main.css

img

  - program-or-be-programmed.jpg

  - the-book-of-trees.jpg

js

  controllers

    - MainController.js

  shared

    - angular-mocks.js

    - angular-route.min.js

    - angular-min.js

  - app.js

index.html

===================================================

 

Step 1:

In app.js, created a new module named myApp. a module contains the different components of an AngularJS app.

var app = angular.module("myApp", []);

 

Step 2:

in index.html, <body ng-app="myApp">. 

ng-app is a directive, it tells AngularJS that the myApp module will live within the <body> element.

 

Step 3:

In MainController.js we created a new controller named MainController. A controller manage the app‘s data.

 

Step 4:

in index.html, added

<div class="main" ng-controller="MainController"> Like ng-app, ng-controller is a directive that defines the controller scope.

 

Step 5:

Inside <div class="main"> we accessed $scope.tittle using {{title}}.

 

AngularJS - Map View

标签:

原文地址:http://www.cnblogs.com/elewei/p/5772485.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!