问题标签 [ionic]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
3404 浏览

angularjs - 如何使用 $rootScope.$broadcast 定位特定的 Ionic 视图

使用 Ionic,调用 $rootScope.$broadcast("$ionicView.enter") 将触发所有具有 $ionicView.enter 事件的事件处理程序的子视图。

如何缩小范围以针对特定视图的处理程序?

0 投票
2 回答
506 浏览

javascript - 在 Ionic AngularJS 中获取未定义的 ngModel

我正在使用Ionic. 在尝试将input元素绑定到$scopevar 时,我变得不确定。

SignupCtrl.js:

注册.html:

应用程序.js:

在调试时,我注意到signupForm.email在将文本插入电子邮件输入后未定义的值。我该如何绑定这两个,我做错了什么?

0 投票
5 回答
11176 浏览

angularjs - Get null response in http get ionic

I'm developing a mobile app using ionic and angularjs. Every thing is so fine , but i don't know why when I'm trying to make a http get request , the failure mathod is called and data is null and the status is 0. What am I doing wrong ? Here is my app.js

0 投票
1 回答
4781 浏览

onclick - click() 上的更改按钮

我正在尝试更改按钮图标 thext 并希望禁用 onClick()。

不幸的是,当我第一次单击时它会更改文本,当我再次单击时它会更改图标但不会禁用它。

在堆栈中,变量在单击事件后正确设置。我真的不知道为什么它不起作用以及为什么当我单击两次时它会改变。

这是我的html:

那是我的控制器:

0 投票
1 回答
558 浏览

cordova - Ionic/Cordova - 是什么决定了显示的键盘操作键?

我似乎在网上找不到任何关于此的内容,但取决于用户点击输入框时显示我的应用程序的哪个屏幕,有时键盘会显示 GO 键,有时会显示 RETURN 键;即显示在键盘的右下角。

我正在为 iOS 和 Android 构建,理想情况下我希望它始终显示返回键。

如何确保键盘始终显示 RETURN 键?

0 投票
0 回答
1381 浏览

javascript - TypeError: Cannot read property 'then' of undefined angularjs:11592

I am using ionic and get this error message, when switiching between my tabs: The error only occurs when switching the tabs and I have got no clue where it might come from:

I think it probably has got something to do with my app.js, where I handle the routing:

I really hope that you can find anything or at least give me a clue where to look at.

Thanks! :)

0 投票
3 回答
1185 浏览

angularjs - Ionic 中的模块化编码

我想知道如何在 Ionic 应用程序中按功能进行编码(这一点应该扩展到所有单页应用程序)。

如果我有一个如下所示的 index.html:

还有一个如下所示的 app.js 文件:

如何加载执行不同任务的不同模块?如果这是加载不同 html 页面(标准 Web 应用程序)的情况,我可以更改页面顶部的模块引用。但是对于 SPA,它每次都会加载相同的 index.html 文件。

那么,我们如何在 Ionic 中实现模块化代码呢?

0 投票
1 回答
5964 浏览

angularjs - 我如何在 ionic 中使 $state.go 在没有过渡动画的情况下移动到其他视图?

好吧,我有一个基于离子应用程序的侧面菜单。

任何视图转换的默认动画都是从右向左滑动;但是对于少数视图,我需要没有过渡动画(没有动画)

我根本无法在任何文档上做到这一点

0 投票
1 回答
1591 浏览

ionic-framework - 如何在 Ionic Framework 中禁用 ion-slide-box 中的交换

我想禁用 ion-slide-box 中的交换,所以我添加了这个

活动幻灯片=“幻灯片停止($index)”

在 ionic-slide-box 中,如下所示

并将其添加到 controller.js

但我收到了这个错误:(

虽然这段代码工作正常:)

0 投票
1 回答
909 浏览

javascript - 带有动态列表的离子标签

我使用 services.js 中的代码创建了一个带有显示动态列表的选项卡的 ionic 项目:

问题是当我加载页面时,我的应用程序最初没有显示列表,但只有当我刷新它(使用 doRefresh)或当我转到其他选项卡并返回第一个选项卡时。有解决方案吗?

先感谢您

我在 ncontroller.js 中的代码:

和我的观点: