मैं विजुअल स्टूडियो पर अपना स्वयं का कोणीय 2/एएसपी.नेट एसपीए बनाने की कोशिश कर रहा हूं। आप सभी फाइलें here पा सकते हैं।कोणीय 2/एएसपी.नेट - "कोई संसाधन लोडर कार्यान्वयन प्रदान नहीं किया गया है। यूआरएल नहीं पढ़ सकता"
मैंने जो करने की कोशिश की वह सरल है: ऐप here सेट अप करने के निर्देशों का पालन करने के बाद, मैंने कुछ बुनियादी रूटिंग करने के प्रयास में अपनी फाइलों में जोड़ना शुरू कर दिया और मैंने कुछ अतिरिक्त फाइलों को हटा दिया। मेरे पास है ClientApp/ऐप्स/app.module.ts बूटस्ट्रैपिंग ClientApp/ऐप्स/घटकों/ऐप्स/ app.component.ts, और केवल मार्ग ClientApp/ऐप्स/घटकों/ऐप्स/test.component.ts है
दुर्भाग्य से, मैं यह त्रुटि आई:
An unhandled exception occurred while processing the request.
Exception: Call to Node module failed with error: Error: No ResourceLoader implementation has been provided. Can't read the url "app.component.html"
at Object.get (C:\Users\Student\Source\Workspaces\mvs\Test2\Test2\node_modules\@angular\compiler\bundles\compiler.umd.js:17454:17)
at DirectiveNormalizer._fetch (C:\Users\Student\Source\Workspaces\mvs\Test2\Test2\node_modules\@angular\compiler\bundles\compiler.umd.js:13455:45)
at DirectiveNormalizer.normalizeTemplateAsync (C:\Users\Student\Source\Workspaces\mvs\Test2\Test2\node_modules\@angular\compiler\bundles\compiler.umd.js:13498:23)
at DirectiveNormalizer.normalizeDirective (C:\Users\Student\Source\Workspaces\mvs\Test2\Test2\node_modules\@angular\compiler\bundles\compiler.umd.js:13473:46)
at RuntimeCompiler._createCompiledTemplate (C:\Users\Student\Source\Workspaces\mvs\Test2\Test2\node_modules\@angular\compiler\bundles\compiler.umd.js:16869:210)
at C:\Users\Student\Source\Workspaces\mvs\Test2\Test2\node_modules\@angular\compiler\bundles\compiler.umd.js:16807:43
at Array.forEach (native)
at C:\Users\Student\Source\Workspaces\mvs\Test2\Test2\node_modules\@angular\compiler\bundles\compiler.umd.js:16805:50
at Array.forEach (native)
at RuntimeCompiler._compileComponents (C:\Users\Student\Source\Workspaces\mvs\Test2\Test2\node_modules\@angular\compiler\bundles\compiler.umd.js:16804:45)
सब कुछ मेरे लिए सही लगता है, लेकिन मैं दोनों कोणीय 2 और ASP.NET के लिए नया हूँ, इसलिए अगर यह एक संकलक मुद्दा है मैं नहीं जानता या मानव त्रुटि। यहां कुछ कोड दिए गए हैं, यदि आपको अधिक जानकारी की आवश्यकता है तो रेपो के लिंक इस प्रश्न के शीर्ष पर हैं।
ClientApp/ऐप्स/app.module.ts
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { UniversalModule } from 'angular2-universal';
import { AppComponent } from './components/app/app.component';
import { TestComponent } from './components/app/test.component';
@NgModule({
bootstrap: [ AppComponent ],
declarations: [
AppComponent,
TestComponent
],
imports: [
UniversalModule, // Must be first import. This automatically imports BrowserModule, HttpModule, and JsonpModule too.
RouterModule.forRoot([
{ path: 'test', component: TestComponent },
{ path: '', redirectTo: 'test', pathMatch: 'full' },
{ path: '**', redirectTo: 'test' }
])
]
})
export class AppModule {
}
ClientApp/ऐप्स/घटकों/ऐप्स/app.component.ts
import { Component, Input } from '@angular/core';
@Component({
selector: 'app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
}
ClientApp/ऐप्स/घटकों /app/test.component.ts
import {Component, Input, OnInit} from '@angular/core';
@Component({
templateUrl: './test.component.html',
styleUrls: ['./test.component.css']
})
export class TestComponent implements OnInit {
testing: String;
ngOnInit(): void {
this.testing = "This Works";
}
}
'app.component.html' मौजूद है? आप इसे कोड में संदर्भित करते हैं, लेकिन क्या आपने इसे बनाया है? –
हां, और यह उसी फ़ोल्डर में है जैसे app.component.ts –
क्या आपको कभी इसका कारण मिला? एक ही मुद्दे w/yeoman उत्पन्न परियोजनाओं में चल रहा है। – ohlando