Importing a component into another component


#1

hi I am trying to import a component(partyAdd.js) into another component(partiesList.js) but for some reason component(partyAdd.js) is not loading . can some tell me what I am doing wrong here . Below is my code

/*partiesList.js */
import angular from ‘angular’;
import angularMeteor from ‘angular-meteor’;
import templateUrl from ‘./partiesList.html’;
import { Parties } from ‘…/…/…/api/parties’;
import { name as PartyAdd } from ‘…/partyAdd/partyAdd’;

class PartiesList {
constructor($scope, $reactive) {
‘ngInject’;

$reactive(this).attach($scope);

this.helpers({
parties() {
   return Parties.find({});		
}
 });

}
}

const name = ‘partiesData’;

// //create a module
export default angular.module(name, [
angularMeteor,PartyAdd
]).component(name, {
templateUrl,
controllerAs: ‘partiesList’,
controller: PartiesList
});

/*partiesList.js */

  • {{party.name}}

    {{party.description}}

/partyAdd.js/
import angular from ‘angular’;
import angularMeteor from ‘angular-meteor’;
import templateUrl from ‘./partyAdd.html’;

class PartyAdd {
constructor() {
this.party={};

}

submit() {
this.reset();
}
reset() {
this.party = {};
}
}

const name = ‘partyAdd’;

// create a module
export default angular.module(name, [
angularMeteor
]).component(name, {
templateUrl,
controllerAs: name,
controller: PartyAdd
});

/main.js/

import angular from ‘angular’;
import angularMeteor from ‘angular-meteor’;
import { name as test } from ‘…/imports/ui/components/partiesList/partiesList’;
//import { name as test2 } from ‘…/imports/ui/components/partyAdd/partyAdd’;
angular.module(‘myApp’,[test])