未捕获的错误:[$ injector:nomod]

时间:2017-11-20 10:32:24

标签: angularjs

我正在使用以下代码。但我收到错误未捕获错误:[$ injector:nomod]。模块名称相同。不知道为什么我收到这个错误。请帮忙。我检查了语法,名称等各地,但找不到任何问题。似乎我错过了一些简单但却无法弄清楚我错误到底的地方。

while true ; do php retrieve4.php ; done > /dev/null 
			angular.module("demo").controller("SimpleDemoController", function($scope) {

				$scope.models = {
					selected: null,
					lists: {"A": [], "B": []}
				};

				// Generate initial model
				for (var i = 1; i <= 3; ++i) {
					$scope.models.lists.A.push({label: "Item A" + i});
					$scope.models.lists.B.push({label: "Item B" + i});
				}

				// Model to JSON for demo purpose
				$scope.$watch('models', function(model) {
					$scope.modelAsJson = angular.toJson(model, true);
				}, true);

			});		
			/**
			 * The dnd-list should always have a min-height,
			 * otherwise you can't drop to it once it's empty
			 */
			.simpleDemo ul[dnd-list] {
				min-height: 42px;
				padding-left: 0px;
			}

			/**
			 * The dndDraggingSource class will be applied to
			 * the source element of a drag operation. It makes
			 * sense to hide it to give the user the feeling
			 * that he's actually moving it.
			 */
			.simpleDemo ul[dnd-list] .dndDraggingSource {
				display: none;
			}

			/**
			 * An element with .dndPlaceholder class will be
			 * added to the dnd-list while the user is dragging
			 * over it.
			 */
			.simpleDemo ul[dnd-list] .dndPlaceholder {
				background-color: #ddd;
				display: block;
				min-height: 42px;
			}

			.simpleDemo ul[dnd-list] li {
				background-color: #fff;
				border: 1px solid #ddd;
				border-top-right-radius: 4px;
				border-top-left-radius: 4px;
				display: block;
				padding: 10px 15px;
				margin-bottom: -1px;
			}

			/**
			 * Show selected elements in green
			 */
			.simpleDemo ul[dnd-list] li.selected {
				background-color: #dff0d8;
				color: #3c763d;
			}		

1 个答案:

答案 0 :(得分:0)

您的模块应该注入空的依赖项

angular.module("demo",[]).controller("SimpleDemoController", function($scope) {