Passing directive to a modal form

Hi All,

I’m trying to load a component inside my modal form. But I cannot figure out how to pass a directive to a modal form.

below is my code

import { Component } from '@angular/core';
import {Modal, Platform, NavParams, NavController,ViewController} from 'ionic-angular';
import {SearchResult} from '../../components/search-result/search-result';

  selector: 'review-beer',
  templateUrl: 'build/components/review-beer/review-beer.html',
  inputs: ['beer'],
export class ReviewBeer {

  beer: any;

  constructor(private nav: NavController) {


     let modal = Modal.create(ReviewContentPage, {'beer':});

  templateUrl: 'build/components/review-beer/modal.html',
  directives: [SearchResult]

class ReviewContentPage{

   private beer: any;

     public platform: Platform,
     public params: NavParams,
     public viewCtrl: ViewController
   ){ = params.get('beer');


#search results.ts
import { Component } from '@angular/core';
import {Rating} from '../../components/rating/rating';
import {ReviewBeer} from '../../components/review-beer/review-beer';

  selector: 'search-result',
  templateUrl: 'build/components/search-result/search-result.html',
  inputs: ['beer'],
  directives: [Rating, ReviewBeer],
export class SearchResult {

  beer: any;

  constructor() {

<ion-avatar item-left>
  <img [src]="beer.beer_image.url">
<rating [rating_summary]="beer.review_summary"></rating>
<review-beer [beer]="beer"></review-beer>

and in the modal view

<search-result [beer]="beer"></search-result>

This is the error I’m getting

browser_adapter.js:77 EXCEPTION: Error: Uncaught (in promise): Unexpected directive value 'undefined' on the View of component 'ReviewContentPage'

but if I remove the directives: [SearchResult], it works fine.

Can someone help me on understanding if this is possible or what I’m doing wrong

thanks in advance



Probably would also need to see the SearchResult code and how it’s used in the template.

Hey @rapropos, Thanks for the reply, I updated my question with code related to search-results.ts and html ^^