kuitos / angular-utils

useful angular utils
61 stars 18 forks source link

no file to load has been found, if you're trying to load an existing module you should use the 'inject' method instead of 'load' #2

Closed flyher closed 8 years ago

flyher commented 8 years ago

image

Error: no file to load has been found, if you're trying to load an existing module you should use the 'inject' method instead of 'load'.


检索了一下,这里似乎是ocLazyLoad的报错:

https://github.com/ocombe/ocLazyLoad/issues/198
kuitos commented 8 years ago

你跑的是我的demo?

flyher commented 8 years ago

@kuitos 你的demo倒是没问题 ~_~

kuitos commented 8 years ago

你要给出完整的上下文信息啊,不然没法帮你看。。。

flyher commented 8 years ago

大略弄了格式简单的demo,
index.html,list.html
是可以正常运行的项目页面,并且有自己封装好的controller

http://files.cnblogs.com/files/flyher/demo.zip
kuitos commented 8 years ago

一个应用只能有一个ng-app

flyher commented 8 years ago

我这种写法是通过封装的,仔细看了好几天,可能我之前并不没弄懂,发现需要先将代码改为原生的方式:

var app = angular.module("xxApp", [])
    .controller("xxController", function ($scope) {
//todo
    })
    .directive('test', function() {
//todo
   });

然后才能用你的这个方式去改造,这是件比较纠结的事情 非常感谢 :+1: 你的帮助