0
I have a page: index.php
and the app.js
. in my app
I make a load
for main.php
which is the initial loading of the site. within the main
he will bring select
, div
with ng-repeat
, ng-source
, etc..
But when the content of the main was part of the index
it worked normal, but now it just doesn’t work anymore it loads the page, plus the directives: ng-repeat
, ng-source
, etc seem not to work. I’ll put an excerpt of the code for you to see
app js.
var app = angular.module("MeuApp", []);
app.controller("MeuAppCtrl", function($scope, $http) {
$scope.msg = "Olá Usuários";
var carregarMain = function() {
$http.get("http://localhost/main.php").success(function(data, status) {
$("#mainPage").html(data);
carregarBanner();
});
};
var carregarBanner = function() {
$http.get("http://localhost/banner.php").success(function(data, status)
{
$scope.banners = data;
alert(data[0].foto);
});
};
carregarMain();
});
index php.
<div id="mainPage"></div>
main.php
<div ng-repeat="banner in banners">
{{banner.foto}}
<div class="item">
<img ng-src="{{banner.foto}}" style="height: 600px;" alt="">
</div>
</div>
puts the full index file to view the Imports
– Israel Zebulon
1 - Put the most complete codes of index and main. 2 - Why are you using php when you are already using angular and jquery? One that in your code has nothing of php being used, another that if you are using angular, have no need to use neither jquery and much less php, the less frameworks you load, the better, both in question of data usage size, how much on the matter of loading time and integrity of your code (helps to have less bizarre error by conflicts between frameworks)
– MarioAleo