javascript - Cannot get started with Angular.js -
i trying follow recipes have seen missing fundamental , cannot out of box :(.
uncaught error: [$injector:modulerr] http://errors.angularjs.org/1.3.0-rc.5/$injector/modulerr?p0=mt_sim&p1=erro…2fmaster.jlbprof.com%2fmt_sim%2fscripts%2fvendor%2fangular.min.js%3a18%3a3) i using linux , apache here layout of directories:
$ tree mt_sim mt_sim ├── img ├── index.html ├── scripts │ ├── controller │ │ └── mt_sim.js │ └── vendor │ ├── angular.min.js │ ├── angular.min.js.map │ ├── angular-route.min.js │ └── angular-route.min.js.map ├── styles │ └── mt_sim.css └── view here mt_sim/index.html
<html ng-app="mt_sim"> <head> <script src="/mt_sim/scripts/vendor/angular.min.js"></script> <script src="/mt_sim/scripts/controller/mt_sim.js"></script> <link href="/mt_sim/styles/mt_sim.css" rel="stylesheet" type="text/css" </head> <body> <div id=outer_div ng-controller="mt_sim_contoller_1"> <div id=inner_left_div> <ul> <li>coffee</li> <li>tea</li> <li>milk</li> </ul> </div> <div id=inner_right_div> <ul> <li>coke</li> <li>pepsi</li> <li>rc cola</li> </ul> </div> </div> </body> </html> mt_sim.js
var mt_sim = angular.module ('mt-sim', []); function mt_sim_controller_1 ($scope) { } mt_sim.css
#outer_div { width: 100%; overflow: hidden; } #inner_left_div { width: 15%; float: left; } #inner_right_div = { width: 83%; } this frustrating have no thought go here.
thanx
bodger
var mt_sim = angular.module ('mt-sim', []); function mt_sim_controller_1 ($scope) { }
should
var mt_sim = angular.module('mt-sim', []); mt_sim.controller("mt_sim_controller_1", function($scope) { $scope.whatever = "something"; }); javascript angularjs
No comments:
Post a Comment