Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass $scope with 2 controllers on 2 different electron windows with $rootScope.$broadcast #12

Open
lucav90 opened this issue Aug 4, 2017 · 1 comment

Comments

@lucav90
Copy link

lucav90 commented Aug 4, 2017

hi,

how can i pass $scope and another variabile with angular on many electron windows?

This is my project:

i have my angular app with your ng-electron. It is very good!

in my index.html i have 2 controllers: home and data.

my data controller html into index.html is:

<div class="datas" ng-controller="data">
    data: {{data}}
</div>

in home controller i have a function to create another electron window with (electron.browserWindow etc) where i load another html file (index2.html).

so, i have 2 electron windows with different html file but same angular controller.

In this index2.html i have the same data controller. This:

<div class="datas" ng-controller="data">
    data: {{data}}
</div>

in data controller, i have inserted the $rootScope.$watch and other to read the new value of $rootscope.data that i change in my first window.

$scope.$on('read_scope', function(response,value) {
    alert('value);
})
$rootScope.$watch('scope', function(newValue, oldValue){ })

But the $rootscope.data value changed is read and works only on the first windows, if i have 2 electron windows open doens't work. The 2° windows load the default $rootscope.data

i want that the 2 electron windows display the changed data in the same moment.

How can do this? How can pass scope on all electron windows?

regards,

@lucav90
Copy link
Author

lucav90 commented Aug 20, 2017

no solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant