angular 开发到现在还是一直半解,所以不知道如何把angular的统一加载改成动态加载。
在不使用ui–route 和 oclazyload 这两个模块的情况下。经过不停的搜索,找到了一篇帖子。
原文章传送门:https://juejin.im/entry/57061ab1a34131004cf5f3c1
原作者github: https://github.com/suweiwua?tab=overview&from=2016-09-06
可以到github上找作者的demo 查看,进行修改。
这里我只把我遇到的问题贴一下:

原作者这里定义了参数basename,我这里根据自己的需求把参数修改了。修改参数后要记得将routeResolver.js 相应参数进行修改。重点(routeResolver.js):

这里的的路由配置controller 指的是你定义的controller名字不是controller的文件名。

这里则是文件的加载路径。
网友评论