title: ERROR Error: Uncaught (in promise): NullInjectorError: R3InjectorError(RegisterPageModule)[AccessProviders -> AccessProviders]
body: <p>I have a problem in my <strong>Ionic</strong> app with <strong>AngularJS</strong>, in <code>register.page.ts</code>; when i am going to add the <code>AccessProviders</code> path in the project the project says:<code>ERROR Error: Uncaught (in promise): NullInjectorError: R3InjectorError(RegisterPageModule)[AccessProviders -&gt; AccessProviders -&gt; AccessProviders -&gt; AccessProviders]:  NullInjectorError: No provider for AccessProviders!</code></p>
  <p><strong>I have created the access providers folder and files manually.</strong></p>
  <p><strong>register.page.ts</strong></p>
  <pre><code>import {Router} from &quot;@angular/router&quot;;
  import { ToastController, LoadingController, AlertController } from &quot;@ionic/angular&quot;;
  import {AccessProviders} from &quot;../../providers/access-providers&quot;;
  
  @Component({
    selector: 'app-register',
    templateUrl: './register.page.html',
    styleUrls: ['./register.page.scss'],
  })
  export class RegisterPage implements OnInit {
  
      name: string = &quot;&quot;;
      gender: string = &quot;&quot;;
      dob: string = &quot;&quot;;
      email: string = &quot;&quot;;
      password: string = &quot;&quot;;
      confirm_password: string = &quot;&quot;;
      disabledButton;
  
    constructor(
        private router: Router,
        private toastCtrl: ToastController,
        private alertCtrl: AlertController,
        private loadingCtrl: LoadingController,
        private accsPrvds: AccessProviders,
    ) { }
  
    ionViewDidEnter() {
        this.disabledButton = false;
    }
  </code></pre>
  <p><strong>access-providers.ts</strong></p>
  <pre><code>import { HttpClient, HttpHeaders, HttpErrorResponse } from &quot;@angular/common/http&quot;;
  import  'rxjs/add/operator/map';
  import  'rxjs/add/operator/timeout';
  
  @Injectable()
  export class AccessProviders {
      server: string = 'http://localhost:8100/register'; //should change.
  
      constructor(
          public http: HttpClient
      ) {
  
      }
  
      postData(body, file) {
          let headers = new HttpHeaders({
              'Content-Type': 'application/json; charset=UTF-8'
          });
  
          let options = {
              headers: headers
          };
  
          return this.http.post(this.server + file, JSON.stringify(body), options)
              .timeout(59000)// 59 sec timeout
              .map(res =&gt; res);
      }
  }
  </code></pre>
  <p><strong>How i can solve this problem?</strong> I hope got my answer.</p>