I'm a beginner with Angular2, currently learning and practicing by doing exercises. I am enrolled in a Udemy course and comparing my exercise progress with the instructions provided.
Here is a snippet from my app.component.ts file:
import {Component} from 'angular2/core';
import {ClienteListaComponent} from './components/cliente-lista.component';
import {ClienteDetalleComponent} from './components/cliente-detalle.component';
@Component({
selector: 'app',
templateUrl: 'app/views/clientes.html',
})
export class AppComponent{
}
The above code defines the bootstrap in main.ts.
import {bootstrap} from 'angular2/platform/browser';
import {AppComponent} from './app.component';
bootstrap(AppComponent);
The code within the "app" selector works perfectly fine. However, I encounter issues when trying to utilize selectors defined in "ClienteListaComponent" or "ClienteDetalleComponent".
I suspect the problem lies in generating the app.component.js file, as only angular2/core is included in system.register and not the other imports.
System.register(['angular2/core'], function(exports_1, context_1) {
"use strict";
var __moduleName = context_1 && context_1.id;
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1;
var AppComponent;
return {
setters:[
function (core_1_1) {
core_1 = core_1_1;
}],
execute: function() {
AppComponent = (function () {
function AppComponent() {
}
AppComponent = __decorate([
core_1.Component({
selector: 'app',
templateUrl: 'app/views/clientes.html',
}),
__metadata('design:paramtypes', [])
], AppComponent);
return AppComponent;
}());
exports_1("AppComponent", AppComponent);
}
}
});
This prevents me from using "ClienteListaComponent" and "ClienteDetalleComponent".
Currently, I'm working with angular 2.0.0-beta.14 as per the requirements of the course I'm enrolled in. Any assistance would be greatly appreciated. Thank you!