onsen-ui

How to set click event for button in onsen ui?

柔情痞子 提交于 2020-02-04 05:03:25
问题 I use phonegap and onsen in my application. How to set click event for button in onsen ui? Thank you. Sorry for my poor english. 回答1: You can use ng-click directive. Because Onsen UI is internally based on AngularJS, learning AngularJS would help you greatly. https://angularjs.org/ page1.html <ons-page ng-controller="yourController"> <ons-button ng-click="foo()">Push Page 2</ons-button> </ons-page> app.js var yourApp = angular.module('myApp', ['onsen.directives']); yourApp.controller(

how to pass more than one value to next page in angularjs

允我心安 提交于 2020-01-17 04:28:06
问题 hello i am newbie to angularjs and using onsen ui in my demo aplication,i have 2 pages in my application,In this i want to pass two values to the next page,i succeed to passing one value but when i am sending second onew it gives me exception of ReferenceError: Restaurant is not defined , i have tried concating string but still same thing happened,so can anybuddy please help me to figure it out,my code is: html <ons-button onclick=gallery.pushPage("list-page.html",{params:'+resid+',params1:'

$anchorScroll not working on after back to Index.html page Onsen UI

谁说胖子不能爱 提交于 2020-01-16 05:20:08
问题 Hello I am new in angular JS and Onsen UI. i have problem $anchorScroll not working if only i back to page1 in index.html. everything is fine if i refresh browser. in index.html i have two page : page1. there is button to navigate to page2 in page2 i have number list : from 1 to 20. After open page2 automatically scroll to list number 5 and the $anchorScroll is working fine. $scope.scrollTo = function(elementId) { $timeout(function() { $location.hash(elementId); $anchorScroll(); }); }; init()

Uncaught TypeError: Illegal constructor at DRE

◇◆丶佛笑我妖孽 提交于 2020-01-15 11:36:11
问题 index.html <!DOCTYPE html> <html> <head> <title>Angular QuickStart</title> <base href="/"> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="styles.css"> <link rel="stylesheet" href="https://unpkg.com/onsenui@2.0.0/css/onsenui.css"> <link rel="stylesheet" href="https://unpkg.com/onsenui@2.0.0/css/onsen-css-components.css"> <script src="https://unpkg.com/onsenui@2.0.0/js/onsenui.js"></script> <!-- Polyfill(s) for older

How to control page routes in the controller?

孤人 提交于 2020-01-13 11:29:10
问题 OnsenUI is great. Fast and easy. However, there is not much documentation for controlling Onsen logic in the controller. Like for instance, I want to do a $location.path('/newpath') inside a controller. How is done in Onsen? I tried "ons.navigator.pushPage('partials/latestjob.html');" in my controller function but doesn't work. Are we limited to ng-click in Onsen to go to another page? Thanks. 回答1: In Onsen UI 1.04, you can access navigator from inside the controller as follows. $rootScope

How to hide popover in onsen ui

杀马特。学长 韩版系。学妹 提交于 2020-01-06 15:07:21
问题 I have been following Drop down option menu using onsen UI, but I want to cancel the popover when tapping on it. Any idea. 回答1: Usually, you can just hide it with popover.hide() , but it seems there is a bug when you try to use again the same controller with a popover containing a list (the browser gets stuck and the CodePen sample get bugged). That's why you need to create another controller to hide the popover and a service to share the popover between the two controllers (Here you can find

How to hide popover in onsen ui

妖精的绣舞 提交于 2020-01-06 15:05:11
问题 I have been following Drop down option menu using onsen UI, but I want to cancel the popover when tapping on it. Any idea. 回答1: Usually, you can just hide it with popover.hide() , but it seems there is a bug when you try to use again the same controller with a popover containing a list (the browser gets stuck and the CodePen sample get bugged). That's why you need to create another controller to hide the popover and a service to share the popover between the two controllers (Here you can find

Using Onsenui cant push between pages

允我心安 提交于 2020-01-05 08:52:32
问题 I have an app that has multipe .html pages instead of 1 page which holds all the pages. I am trying to use ons.navigator.pushPage("path/to/page.html", {foo: "bar"}); but it doesnt work However, doing this works: <p align="center"><ons-tabbar-item page="activity.html" should-spin="false"><ons-button modifier="large--cta">view</ons-button></ons-tabbar-item></p> But this doesnt work: <p align="center"><ons-button modifier="large--cta" ng-click="ons.navigator.pushPage('activity.html', {foo: 'bar'

What's the usecase for ons.ready()?

廉价感情. 提交于 2020-01-04 08:07:52
问题 I'm trying to build an app using OnsenUI 2 (rc12 currently) and jQuery (3.0.0). There are many examples using the ons.ready() to do ... something. What confuses me is that Getting started example on their website uses the function. (Both examples are headers of the index.html) <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <link rel="stylesheet" href="lib/onsen/css/onsenui.css"/> <link rel="stylesheet" href="lib/onsen/css/onsen-css-components.css"/> <script src="lib/onsen/js