Not really as i don’t have to experience in Angular
What about going web component ? this way framework will ne universal
Hi @Pero_Knezevic , I’m going crazy on this topic, can you tell me what you do to use angularjs with f7?
thank you very much
Hi @sixdas, I can send you start project with Angularjs inside and you can go with that as a start. Or push on some repo and send you link…
it would be really cool to have links to a project. i currently still haven’t set one up as i couldn’t integrate angular
thanks a lot
Hi @Pero_Knezevic in these days I have done some tests, but without success, I turned a bit on google, and someone recommends the solution of $ compile, but it doesn’t work or I am doing something wrong (surely).
I created a project on github, which would be the base where I start a project, as soon as you can take a look at it and suggest me where am I wrong?
Thank you
Sure I will clone your project and make PR to it ok, maybe is the best way. I’ll will avoid using JQ here with Angular, it’s not necessary.
Sorry, but lack of time couses slower response from my side.
You didn’t create a Controller. I will update your code.
ok thanks, make any changes you deem appropriate
You need to give me pernmissions to git. username: djpero
ok done, let me know need more
I created PR. You will get point when you see code. You must stick to one controller due ajax page loading but you can identify pages so you can separate code and know when page is inited.
ok thanks okay, but i wanted to use a controller for every single page. With your example I am limited to only one.
Quite right?
Yes, you are limited, but you can achieve whatever you want. Don’t see what are features you need with every single controller? This is a lack of structure, but functionality-wise doesn’t matter because it works
ok, maybe I’m right wrong. I make you a last request, could you give me an example with more pages? in order to understand how to manage it all.
Thanks
You can have but controller inside controller only with an alias to some other name inside the controller itself.
You have PR which have the example of this approach with controllers and with pages. Check console log to see what’s going on.
great, now it’s very close to what I was asking for. I have one last question why you always do
$$(document).on('page:init', function(e, page) {
if (page.name === 'testPage') {
$compile(e.target)($scope);
$scope.$apply();
console.log('compiled test page');
}
if (page.name === 'aboutPage') {
$compile(e.target)($scope);
$scope.$apply();
console.log('compiled about page');
}
})
For single page loaded, could not it be done directly like this?
$$(document).on('page:init', function(e, page) {
$compile(e.target)($scope)
$scope.$apply();
})
What to change?
Thanks
Yea looks strange but surely let’s keep repeating it like it is. I had a lot of issues later when project growth and have multiple pages inside another etc, it can mess things with compile. Maybe the compiler has issues ( I didn’t go so deep inside the problem ) but I have fixed it like this.
If you using this approach with pages to detect where you are and to run some code on the init page, I would suggest keeping using it as is.
You should use it as start and maybe find better way to solve it, but it works as is.