Reveal Modal中带有Foundation-Controller的AngularJS不起作用
AngularJS with Foundation - Controller in Reveal Modal does not work
我在使用AngularJS方面没有太多经验,但我不是新手。已经用了一点了。
然而,我正在使用AngularJS与Zurb Foundation 6。我展示的模态中的控制器不会使用任何角度。例如,我可以写{{hallo}}
,但他不会渲染它,他会给我看{{hallo}}
,而不是这个变量的值。
你必须知道,这个模态在angular的模板文件中,因为我使用的是angular route。奇怪的是,我已经在index.html文件中使用了一个模态,而模态工作中有angular。但是模板文件(称为dashboard.html)中的模态不起作用。
这是我的模式:
<div class="row">
<div class="columns large-12 medium-12 small-12" ng-controller="LoadAllUsers">
<button class="button" data-open="newUserModal" ng-click="load()">User hinzufügen</button>
<!-- newUserModal -->
<div class="tiny reveal" id="newUserModal" data-reveal>
<div class="large-12 medium-12 small-12 columns">
<div class="row">
<h4 class="text-center">User zur Miete hinzufügen</h4>
<br>
<label>Username oder Name des neuen Users eingeben</label>
<input type="text" placeholder="Max Mustermann" name="newuser" ng-model="userSearch" ng-change="search()">
<h5>Suchtreffer</h5>{{hallo}}
<button class="button" data-close>Abbrechen</button>
<button class="button float-right">User hinzufügen</button>
</div>
</div>
<button class="close-button" data-close aria-label="Close modal" type="button">
<span aria-hidden="true">×</span>
</button>
</div>
<!-- /newUserModal -->
<button class="button">Miete zurückziehen</button>
</div>
</div>
</div>
我的控制器看起来像这个
routingApp.controller("LoadAllUsers", function($scope, $http) {
$scope.load = function() {
var allUsers = [];
$http({
method: 'GET',
url: 'someURL',
params: {parameters: "values"}
}).then(function successCallback(response) {
angular.forEach(response.data, function(value, key) {
allUsers[key] = {};
angular.forEach(value, function(subvalue, subkey) {
allUsers[key][subkey] = subvalue;
});
});
$scope.hallo = "AN";
console.log(allUsers);
}, function errorCallback(error) {
console.log(JSON.stringify(error.data));
});
};
$scope.search = function() {
console.log($scope.userSearch);
};
$scope.hallo = "HAAAAAAAAAAALLO";
});
如果有人能帮助我,我将不胜感激。感谢
我找到了解决方案:我向用户Angular Foundation 6致敬。你必须知道的是,它目前正在工作中,所以它可能不如Angular Foundation 5稳定。然而,它帮助我解决了我的问题。
相关文章:
- 我的AngularJS表达式没有'不起作用
- AngularJS指令部分应用的函数don'不起作用
- AngularJS ng include dons'不起作用
- AngularJs和Laravel的Pretty Urls不起作用
- Google Maps API OverlayView()在AngularJS指令中不起作用
- AngularJS ng include won'不知什么原因不起作用
- AngularJS没有'不起作用
- Grunt concat js angularjs 不起作用
- angularjs ng点击运行时标记不起作用
- AngularJS:$on dons'不起作用
- AngularJS-简单的教程不起作用
- 输入类型范围在angularjs重复内不起作用
- Reveal Modal中带有Foundation-Controller的AngularJS不起作用
- angularjs不起作用的Json响应
- 过滤器搜索与 AngularJs 不起作用
- 带有jquery自动完成的Angularjs不起作用
- 从php获取数据到angularjs不起作用
- 使用$httpBackend测试Jasmine/Karma的AngularJS不起作用
- $ statprovider angularJs不起作用
- 使用ngRoute使jquery tab使用angularjs不起作用