No.142857

Results 6 comments of No.142857

@Treri 我应该用的方法不对,但是公司项目因为历史原因,实在没有办法. 我用require定义了一个app模块 ``` js define(["angular", "uiRouter", "ngRequire"], function() { var app = angular.module('app', ['ngRequire', 'ui.router']); app.config(function($stateProvider, $urlRouterProvider, $requireProvider) { $urlRouterProvider.otherwise('/create'); $stateProvider .state('create', { //创建 url: '/create', templateUrl: '/assets/templates/promotion/create.html', controller:...

最终我还是解决了这个问题, 我写在了我的博客里: https://alili.tech/archive/5ff0b366/ 大致有三种解决方案. 1. 通过事件做到模块之间的通讯,再使用模块的路由做页面跳转 2. 统一使用hash路由 3. 像react一样统一模块的路由核心库`history`,通过customprops传入每个模块 In the end, I solved this problem. I wrote it on my blog: https://alili.tech/archive/5ff0b366/ There are roughly three solutions. 1....

![企业微信截图_027a0b0c-ca54-4784-8875-a4f4da58644a](https://user-images.githubusercontent.com/9129438/72402071-ee38c800-3788-11ea-9b35-b3b8ea721dfc.png)

![gh_9861e79571cf_430](https://user-images.githubusercontent.com/9129438/72402129-293afb80-3789-11ea-9640-54993d1012dd.jpg)