正在我的angulrajs项目中添加 import React from 'react';
const styles = {
backgroundColor: "#EF3829",
color: "#fff",
borderRadius: "0px"
}
export const TYPES = {
PRIMARY: 'btn-primary',
WARNING: 'btn-warning',
DANGER: 'btn-danger',
SUCCESS: 'btn-success',
}
export const Button = (props) => (
<button
onClick={props.onClick}
style={styles}
className={ props.buttonType || TYPES.PRIMARY }
>
{props.label}
</button>
);
fastselect demo插件。我无法将值传递给fastselect
函数。
这是我的代码:
addshop.html:
$scope.addData
addshop.js:
<form class="form-horizontal" name="addForm" novalidate ng-submit="addData(addForm)">
<div class="col-sm-6">
<label>Sub Directory Name<code>*</code></label>
<select class="multipleSelect" name="category_id" ng-model="formData.category_id" ng-options="category_id.id as category_id.name for category_id in formData.getSubDirectories" ng-required="true" multiple>
</select>
</div>
</form>
<script src="https://rawgit.com/dbrekalo/attire/master/dist/js/build.min.js"></script>
<link rel="stylesheet" href="https://dbrekalo.github.io/fastselect/dist/fastselect.min.css">
<script src="https://dbrekalo.github.io/fastselect/dist/fastselect.standalone.js"></script>
<script>
$('.multipleSelect').fastselect();
</script>
图片:
上面的图片我选择了
'use strict'; app.controller('AddShopsController', ['$scope', '$http', '$state', 'authServices', '$sessionStorage', 'webServices', 'utility', '$rootScope', '$stateParams', '$timeout', 'toaster', '$filter', function($scope, $http, $state, authServices, $sessionStorage, webServices, utility, $rootScope, $stateParams, $timeout, toaster, $filter) { $scope.addData = function(form) { console.log($scope.formData.category_id); // selected values } $scope.getSubDirectories = function() { webServices.get('getSubDirectories').then(function(getData) { $rootScope.loading = false; if (getData.status == 200) { $scope.formData.getSubDirectories = getData.data; } else { $rootScope.$emit("showerror", getData); } //console.log($scope.formData.getSubDirectories); }); } $scope.getSubDirectories(); }]);
选项,我无法将Jewellery
的值传递给我的Jewellery
函数。