将范围放入另一个范围

时间:2016-05-03 08:45:43

标签: html angularjs node.js

我有DisplayAlert范围,我想放在我的selectAttraction范围内。我希望窗口警报提示以及单击提交按钮时显示所选输入。

attraction.js

angular
        .module('app')
            .controller('AllAttractionController', ['$scope', 'attraction','$window', function ($scope, attraction, $window) {
                $scope.attractions = attraction.find();



                $scope.imgpath=function(imgName){
                return "../img/"+ imgName;
            };

                $scope.selectAttraction = function()
                {
                    var selected = '';

                    for (var i = 0; i < attractions.length; i++) {
                        if(attraction[i].selected){
                                selected += attraction[i].attractionName;
                        }

                    }

                };
                $scope.DisplayAlert = function(message){
                    $window.alert(message);
                };


            }]);

全attraction.html

<input type="submit" value="Submit" ng-click="selectAttraction('Test')" ui-sref="view-attraction">

0 个答案:

没有答案