How use TemplateUrl to access an HTML in imports


#1

I new in angular-meteor and I’ve been having trouble with templatUrl: 'imports/components/AddClass/AddClass.html’
it doesn’t work

I use angularui:angular-ui-router packages

in client/app.js
import angular from ‘angular’;
import angularMeteor from ‘angular-meteor’;

angular.module(‘AttendanceSystem’, [
angularMeteor,
‘ui.router’
]);

angular.module(‘AttendanceSystem’).config(RoutesConfig);

RoutesConfig.$inject = [’$stateProvider’, ‘$urlRouterProvider’];
function RoutesConfig($stateProvider, $urlRouterProvider) {

// Redirect to AddClass if no other URL matches
$urlRouterProvider.otherwise(’/’);

//Set up UI states
$stateProvider
.state(‘Home’, {
url:’/’,
templatUrl: ‘main.html’
})
$stateProvider
.state(‘AddClass’, {
url:’/AddClass’,
templatUrl: ‘imports/components/AddClass/AddClass.html’
});
}

in imports/components/addClass/addClass.html

Add Class
Course Name Submit

in imports/components/addClass/addClass.js
import angular from ‘angular’;
import angularMeteor from ‘angular-meteor’;
import template from ‘./addClass.html’;

class AddClassCtrl {
constructor() {
}
}

export default angular.module(‘addClass’, [
angularMeteor
])
.component(‘addClass’, {
templateUrl: ‘imports/components/addClass/addClass.html’,
controller: AddClassCtrl
});

in client/main.js
import ‘…/imports/components/AddClass/AddClass’;