面試第一天,總結下碰到的不熟練的問題,備查: $state.go(to [, toParams] [, options]) Returns a Promise representing the state of the transition. Convenience method for trans ...
面試第一天,總結下碰到的不熟練的問題,備查:
- Ionic中,如何在切換tabs標簽頁面的時候,上一個頁面填寫的內容不消失(我之前的經驗是,需要錄入內容的頁面,直接是全屏的,不允許tab切換,後咨詢大神,推薦使用indexDB存儲)
- 路由跳轉,$sate.go() 和 $state.translateTo()的區別(摘自stackoverflow大意就是 前者底層調用的後者,推薦使用前者):
$state.go(to [, toParams] [, options])
Returns a Promise representing the state of the transition.
Convenience method for transitioning to a new state.
$state.go
calls$state.transitionTo
internally but automatically sets options to{ location: true, inherit: true, relative: $state.$current, notify: true }
. This allows you to easily use an absolute or relative to path and specify only the parameters you'd like to update (while letting unspecified parameters inherit from the current state).$state.transitionTo(to, toParams [, options])
Returns a Promise representing the state of the transition.
Low-level method for transitioning to a new state.
$state.go()
usestransitionTo
internally.$state.go()
is recommended in most situations. - angular項目中腳本非同步載入:非同步載入使用script.js, angular-loader解決非同步調用腳本的依賴關係問題, 在$script 的回調中 使用 angular.bootstrap(document, ['myApp']);
- angular項目中使用了哪些插件,其實側重點不是使用了哪些,而是要強調angular不推薦DOM操作,不使用jQuery,也就是很多插件用不了