Angular - different route, same template/controller,different loading method

后端 未结 2 449
说谎
说谎 2021-02-08 10:42

I want to use routes, but I always want to use same template & controller. I have routes like this:

**a/:albumid**

and

**i/         


        
2条回答
  •  南笙
    南笙 (楼主)
    2021-02-08 11:37

    I created a super simple directive to handle this that allows routes to be have more like Rails or Codeigniter routes where the controller method is in the route definition. The method name is set in the routeProvider.when options and the directive is set in the template for the route. See: https://stackoverflow.com/a/22714634/250991

提交回复
热议问题