ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# Angular项目测试 ## 项目结构 ![](https://box.kancloud.cn/2016-09-07_57cf8e0e7a4df.png) ## bower.json文件 ~~~js { "name": "ng1", "description": "", "main": "", "license": "MIT", "homepage": "", "ignore": [ "**/.*", "node_modules", "bower_components", "test", "tests" ], "dependencies": { "angular": "1.2.18" } } ~~~ ## index.html文件 ~~~html <!DOCTYPE html> <html lang="en" ng-app="myapp"> <head> <meta charset="UTF-8"> <title>Title</title> <script src="bower_components/angular/angular.min.js"></script> <script src="js/my.js"></script> </head> <body> <div ng-controller="app_c"> <ul> <li ng-repeat="item in data"> {{item}}</li> </ul> </div> </body> </html> ~~~ ## js/my.js文件 ~~~js //定义angular模块 var app=angular.module('myapp',[]); //定一个控制器 app.controller('app_c',['$scope',function ($scope) { //数据模型 $scope.data=['aaaa','bbbbbbb','cccccccc','ddddddddddd','eeeeeeeee']; }]); ~~~ ## 运行结果: ![](https://box.kancloud.cn/2016-09-07_57cf8e84076b8.png)