Identifier 'methodname' is not defined in ionic - ionic-framework

I am a newbie in ionic, Just created a blank app and trying to add an action to a button. I am getting the following error – ‘Identifier ‘buttonClicked’ is not defined. The component declaration, template variable declarations, and element references do not contain such a member’. Please let me know what I am doing wrong here?
Sample code

You have to create the corresponding method in your home.page.ts file. In the Screenshot i see, that you have opened the home.module.ts file, but your method has to be in the home.page.ts file.

Your HTML call of the ion-button component is correct.
Your code snapshot does not show the TypeScript (.ts) part though.
You should have the corresponding method in there. Something like:
onClick() {
console.log("button clicked ok");
}

Related

Ionic View is not Updating with Two way Data Binding

I am creating very basic ionic app. I want to show splash, then admob interstitial and on close of interstitial, i want to redirect to home page.
The only problem which I am facing here is updating the view in the home page. In home page, i have very simple text box and button. I am using 2 way data binding here and its not working at all.
I have created repo for this if somebody wants to have a look and let me know why the view is not updating.
https://github.com/krishnaa99/admobissue
Demo Video
https://www.youtube.com/watch?v=t_BKJ1mGpag
if the value is changing in component but not in view(html) then after action in component use this.
import { ChangeDetectorRef } from '#angular/core';
constructor(private changeRef: ChangeDetectorRef){}
this.changeRef.detectChanges();
i hope it can help.
Possible solutions you can try
you should check the logs for errors
Assign clear type to "input" variable. ( try making it explicitly
public )
"input" may be considered as a keyword, try using a different
variable name ( less likely )

Play! Framework (2.6.2) passing route with type Call to custom view

I have a question about passing a play.api.mvc Call parameter from one .scala.html file to another. The basic idea of the view I want to create is a reusable confirmation dialog that shows up on different actions, and different screens. So being able to pass a Call parameter that gets executed when the user clicks Yes.
Here is the code I am using in my customConfirm.scala.html view:
#(call: Call)
<div>
<div> Are you sure ? </div>
Yes
<div> No </div>
</div>
And this is the code where I am calling it:
#views.html.partials._customConfirm(#routes.HomeController.welcome())
This last peace of code gives me a compilation error:
illegal start of simple expression
Am I missing something, or is this method a completely wrong way of going about it? Any help would be greatly appreciated!
Omit the # when calling the reverse router:
#views.html.partials._customConfirm(routes.HomeController.welcome())

ionic tab doesn't show correctlly

I use the codes as following to jump to "account" if the user is logined:
.controller('LoginCtrl', function($scope) {
if (is_login) {
$state.go('account');
}
})
But the content was covered by the header.
But the content was covered by the header
If you are using <ion-header-bar> instead of <ion-nav-bar> you might need to use class="has-header" because this way ionic does not arranges ion content tags content automatically. Also do not forget to initialize the ngApp in your javascript code. Also as I experienced before javascript errors might cause the problem as well, check for errors. Here is an example for above: http://jsbin.com/pagacohovohe/1/edit?html,js,output

Magento Contact Form missing

really strange my contact us is missing in the footer and on the navigation bar
i have custom theme and it was before working but not anymore .
here is the message it giving me when i go by the link .
Fatal error: Call to a member function setFormAction() on a non-object in /mounted-storage/home159/sub018/sc85272-SRLF/caramellachocolates.com/ccd/app/code/core/Mage/Contacts/controllers/IndexController.php on line 55
ive also copied the contacts folder from the default theme and pasted in custom i also copied the xml file from default and pasted in custom . but still getting this error.
Hello add below code into indexcontroller.php may be help you
require_once 'Mage/Contacts/controllers/IndexController.php';
class MyNameSpace_Yourmodule_Contacts_IndexController extends Mage_Contacts_IndexController
{
//do somthing
}

How to check if class was added with javascript?

I add a class to an input field when the text changes using jquery in the document.onready function.
$('#formid2 input').on('change', function (e) {
$(this).addClass('changed');
});
Is there a way to verify using chrome dev tools whether the class was really added?
Right click the input field, click on inspect element, and then look at the html to see if it is there. Inside the <input> tag you should see class="changed" or whatever the name of the class is that you added.