基于其他使用angularjs过滤器

时间:2017-07-28 12:42:32

标签: javascript jquery angularjs ui-select

我已将ui select用于我的angularjs项目

国家/地区列表

    [{
        "_id": "596dbedd7892ca3f3e331aca",
        "updatedAt": "2017-07-18T07:55:09.318Z",
        "createdAt": "2017-07-18T07:55:09.318Z",
        "countryName": "australia",
        "countryCode": "ABC",
        "countryCurrencyCode": "ABC",
        "countryCurrencySymbol": "*\r",
        "slug": "australia",
        "sortNo": 2,
        "createdBy": "57eb8bf7216c5a624b19a504",
        "modifiedBy": "57eb8bf7216c5a624b19a504",
        "version": "nil",
        "__v": 0,
        "isActive": true
    }, {
        "_id": "5972ed8dd470521889c468b9",
        "updatedAt": "2017-07-26T10:54:05.817Z",
        "createdAt": "2017-07-22T06:15:41.356Z",
        "countryName": "India",
        "countryCode": "IND",
        "countryCurrencyCode": "INR",
        "countryCurrencySymbol": "¥",
        "slug": "india",
        "sortNo": 4,
        "createdBy": "57eb8bf7216c5a624b19a504",
        "modifiedBy": "57eb8bf7216c5a624b19a504",
        "version": "nil",
        "__v": 0,
        "isActive": true
    }, {
        "_id": "5972ed8dd470521889c468ba",
        "updatedAt": "2017-07-22T06:18:08.309Z",
        "createdAt": "2017-07-22T06:15:41.365Z",
        "countryName": "unitede kingtom",
        "countryCode": "XYZ",
        "countryCurrencyCode": "XYZ",
        "countryCurrencySymbol": "#",
        "slug": "unitede-kingtom",
        "sortNo": 5,
        "createdBy": "57eb8bf7216c5a624b19a504",
        "modifiedBy": "57eb8bf7216c5a624b19a504",
        "version": "nil",
        "__v": 0,
        "isActive": true
    }, {
        "_id": "59786d52618a2b796c13593f",
        "updatedAt": "2017-07-26T10:22:10.957Z",
        "createdAt": "2017-07-26T10:22:10.957Z",
        "countryName": "QWEE",
        "countryCode": "WEWQ",
        "countryCurrencyCode": "ING",
        "countryCurrencySymbol": "€",
        "slug": "qwee",
        "sortNo": 7,
        "createdBy": "57eb8bf7216c5a624b19a504",
        "modifiedBy": "57eb8bf7216c5a624b19a504",
        "version": "nil",
        "__v": 0,
        "isActive": true
    }, {
        "_id": "597b0521e0d5ae36c3d4aadb",
        "updatedAt": "2017-07-28T09:42:39.755Z",
        "createdAt": "2017-07-28T09:34:25.959Z",
        "countryName": "india",
        "countryCode": "IND",
        "countryCurrencyCode": "AUS",
        "countryCurrencySymbol": "€",
        "slug": "india-SJ5XStOIZ",
        "sortNo": 10,
        "createdBy": "57eb8bf7216c5a624b19a504",
        "modifiedBy": "57eb8bf7216c5a624b19a504",
        "version": "nil",
        "__v": 0,
        "isActive": true
    }]

,在其他用户界面中选择州列表

[{
        "_id": "596dcfbfe25f9d4738bea7d9",
        "updatedAt": "2017-07-18T09:07:11.835Z",
        "createdAt": "2017-07-18T09:07:11.835Z",
        "countryId": "596dbedd7892ca3f3e331aca",
        "stateName": "south australia",
        "timezone": "58c6516abf49c40fce836a1b",
        "sortNo": 0,
        "createdBy": "57eb8bf7216c5a624b19a504",
        "version": "nil",
        "__v": 0,
        "isActive": true,
        "slug": "south-australia"
    }, {
        "_id": "596dcfbfe25f9d4738bea7db",
        "updatedAt": "2017-07-18T09:07:11.846Z",
        "createdAt": "2017-07-18T09:07:11.846Z",
        "countryId": "596dbedd7892ca3f3e331aca",
        "stateName": "western australia",
        "timezone": "58c64e1abf49c40fce836a1a",
        "sortNo": 2,
        "createdBy": "57eb8bf7216c5a624b19a504",
        "version": "nil",
        "__v": 0,
        "isActive": true,
        "slug": "western-australia"
    }, {
        "_id": "596dd0ede25f9d4738bea7dd",
        "updatedAt": "2017-07-18T09:12:13.161Z",
        "createdAt": "2017-07-18T09:12:13.161Z",
        "countryId": "596dbedd7892ca3f3e331aca",
        "stateName": "new south wales",
        "timezone": "58c64e1abf49c40fce836a1a",
        "sortNo": 4,
        "createdBy": "57eb8bf7216c5a624b19a504",
        "version": "nil",
        "__v": 0,
        "isActive": true,
        "slug": "new-south-wales"
    }, {
        "_id": "59786e36618a2b796c135941",
        "updatedAt": "2017-07-26T10:25:58.705Z",
        "createdAt": "2017-07-26T10:25:58.705Z",
        "countryId": "59786d8d618a2b796c135940",
        "stateName": "tets@123",
        "timezone": "58c64e1abf49c40fce836a1a",
        "sortNo": 5,
        "createdBy": "57eb8bf7216c5a624b19a504",
        "version": "nil",
        "__v": 0,
        "isActive": true,
        "slug": "tets123"
    }]

在这里,我有两个UI选择。一个是国家,另一个是州名单。当用户单击国家/地区列表时,必须使用angualrjs FILTER基于_id过滤状态列表。

我们可以通过使用过滤器进行正常选择,但是在UI中选择如何做到这一点?

0 个答案:

没有答案