Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228598

Send parameters to Component

$
0
0

indent preformatted text by 4 spaces In the test.html page you are using brackets around your property which signifies that the value, in this case "Something," is binding the property to the variable Something. Looking at the constructor there has been one set. So you would either need to set up a variable or remove the brackets.

This would send fixed value of something:

<ion-content padding class="getting-started">
   <my-component test="Something"></my-component>
</ion-content>

Or like this:

<ion-content padding class="getting-started">
   <my-component [test]="Something"></my-component>
</ion-content>

import {Page} from 'ionic-framework/ionic';
 import {MyComponent} from './myComponent';

@Page({
 templateUrl: 'build/pages/test/test.html',
 directives: [MyComponent]
 })

export class TestPage {
 Something: string;
 constructor() {
     this.Something = 'Something';
 }
 }

Viewing all articles
Browse latest Browse all 228598

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>