Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- method() {
- if ($state.current.name === 'panelA') {
- do_something_for_panel_A();
- }
- if ($state.current.name === 'panelB') {
- do_something_for_panel_B();
- }
- }
- angular.module('my-app')
- .directive('panelOne', function () {
- return {
- restrict: 'E',
- templateUrl: 'panel.html',
- controllerAs: 'panelCtrl',
- controller: 'PanelOneController',
- scope: true
- };
- });
- angular.module('my-app')
- .directive('panelTwo', function () {
- return {
- restrict: 'E',
- templateUrl: 'panel.html',
- controllerAs: 'panelCtrl',
- controller: 'PanelTwoController',
- scope: true
- };
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement