this is my simple code , i'm trying opening a modal and when opened to put data inside via controller and view, but actually still only printing "{{ i }}" inside modal
html
<body ng-controller="AppController">
<div id="modal">
<div id="modal-content"></div>
</div>
<button class="btn btn-option" onclick="modal({src:'views/layout/modals/modal.html'});">
open
</button>
</body>
modal.html :
<div ng-repeat="i in config.app_genres.genres">
{{ i }}
</div>
app.js:
.controller('AppController', function($scope,$location,$http) {
$scope.config = {};
$scope.config.app_ws = "http://localhost/And/www/";
$scope.config.app_name = "Appname";
$scope.config.app_short_description = $scope.config.app_name+" helps you go out with your rabbit";
$scope.config.app_motto = "hey ohhhhhhhhhh <i class='icon-check'></i>";
$scope.config.app_url = $location.url();
$scope.config.app_path = $location.path();
$http.get($scope.config.app_ws+'jsons/json.json').success(function(response) {
$scope.config.app_genres = response;
});
modal() js function:
function modal(_options){
/*
options = {
html:html to load,
src: false | url
}
*/
var modal = document.getElementById('modal'),
modal_content = document.getElementById('modal-content');
if(_options){
if(_options.html){
modal_content.innerHTML = _options.html;
show(modal);
}
if(_options.src){
_load(_options.src,modal_content) ;
show(modal);
}
}else{
console.log('Please set modal options');
}
}