How to include one partial into other without creating a new scope?

后端 未结 4 1909
后悔当初
后悔当初 2020-12-02 14:10

I\'ve this routes.

// index.html
One Two
4条回答
  •  无人及你
    2020-12-02 14:39

    You can actually do this without using a shared service. $scope.$emit(...) can dispatch events to the $rootScope, which can listen for them and rebroadcast to the child scopes.

    Demo: http://jsfiddle.net/VxafF/

    Reference: http://www.youtube.com/watch?v=1OALSkJGsRw (see the first comment)

提交回复
热议问题