我有一個相對簡單的問題,但無法找到它的解決方案呢。我正在使用Ember並使用查詢參數調用路由。代碼如下。Ember QueryParams with「=」character
從「ember」導入Ember;
export default Ember.ObjectController.extend({
queryParams : ['user_id','custom_lis_person_name_given']
user_id : null,
custom_lis_person_name_given : null
});
所以現在可以說,我打電話我用下面的URL路徑,
localhost:4200/index.html#/route1?user_id=123456&custom_lis_person_name_given=hello
現在查詢參數的值是
user_id = 123456
custom_lis_person_name_given = hello
,如果我現在我的網址更改爲看起來像
localhost:4200/index.html#/route1?user_id=12345=6&custom_lis_person_name_given=hello
localhost:4200/index.html#/route1?user_id=123456=&custom_lis_person_name_given=hello
現在th e值的計算方式如下:
user_id = 12345 or user_id=123456
custom_lis_person_name_given = hello
所以基本上這個值在查詢參數值中看到a = sign的地方結束。有沒有解決方法?我需要的USER_ID = 「12345 = 6」或「123456 =」
也許有在控制器或路線一些鉤子可以做到這一點。我試過serializeQueryParam和deserializeQueryParam但它沒有幫助。
由於提前
我有一個解決方法,在使用URL之前轉義queryParamter。我只是**逃生('123456 =')**,它的工作。但在應用程序中,url在後端被創建。如果我可以在UI端完全修復它會更好 – aneeshere 2015-02-09 08:17:43