I have this example:
controller : function() {
var responseFolder = m.prop("");
var pathDirectory = m.prop("C://");`
function clickChangeFolder(folder) {
pathDirectory(pathDirectory() + folder + "/");
responseFolder(m.request({
method : "GET",
url : "my url",
data : {root:pathDirectory()}
}));
}
return {
responseFolder: m.request({
method : "GET",
url : "http://localhost:8080/Mithril_directory/GetFolders",
data : {root:pathDirectory()}
}),
}
view : function(ctrl) {
return [
m("ul" , ctrl.responseFolder().map(function(folder) {
return [
m("li.liFolder" , {
onclick : ctrl.clickChangeFolder.bind(null, folder.name)
},
folder.name),
];
})
]}
The first time the request is ok but when I click in the folder the second request is ok but the view not redraw, why?