npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fcx-minddale

v1.1.2

Published

This is an Angular client library for Minddale

Downloads

29

Readme

Minddale

Minddale

Minddale is a suite of services provided by Firecodex to help you build your brands digitally immortal!

Library

This fcx-mindale (v1) is an Angular client library for Minddale, i.e. an ngx library to get your Angular web page connected to the platform and get the services done.

This library has both service to post newsletter or contact and components to have newsletter or contact forms.

Setup

This library is a very simple module added to your Angular project to use the service or components.

Install

Run cd your-app & npm i fcx-minddale --save

Import

As any other module, first import MinddaleModule in the app.module.ts file.

import { MinddaleModule } from 'fcx-minddale';

@NgModule({
  ...,
  imports: [
    ...,
    MinddaleModule
  ],
  ...
})
export class AppModule { }

Note: There is a good chance that the public APIs in the library are not exposed to import. In that case, you may have to add them to the tsconfig.json file compiler path explicitly as follows.

  "compilerOptions": {
    ...,
    "paths": {
      "fcx-minddale":[
        "./node_modules/fcx-minddale/src/public-api"
      ]
    }
  },

Dependency

As this library uses rxjs v7.x features like firstValueForm module, please upgrade your project rxjs version to at least v7.x, as detailed here.

e.g. "rxjs": "~7.8.1"

Use

Once a client is registered with Minddale, it will be provided with a Client ID and Client Secret to connect with the platform.

Note: Make sure you keep the Client ID and Secret securely in environment file or any other secure methods.

For the purpose of publishing any Newsletter or Contact JSON data, you may use contact or newsletter components as it is, or make use of the service methods to publish contact or newsletter.

Note: In case you are not making the request from your registered domain (website), make sure you are setting the registered client domain as well in the request.

Service Methods

In order to publish either Newsletter or Contact JSON data, use the service methods as follows.

// Import Service and Models
import { MinddaleClient, MinddaleService, Newsletter, Contact } from 'fcx-minddale';
  ...
  private minddaleClient: MinddaleClient;
  // Inject Service
  constructor(private minddaleService: MinddaleService) {
    this.minddaleClient = {
      id: environment.clientId, 
      secret: environment.clientSecret,
      domain: environment.clientDomain // Required only if from locahost or unregistered domain
    } as MinddaleClient;
  }
  ...
  // Publish Newsletter
  public async publishNewsletter() {
    if(this.email) {
      let message = await this.minddaleService.publishNewsletter(this.minddaleClient, {email: this.email} as Newsletter);
      alert(message);
    }else {
      alert('Please enter valid email to subscribe!');
    }
  }
  ...
  // Publish Contact
  public async publishContact() {
    if(this.email && this.subject && this.message) {
      let status = await this.minddaleService.publishContact(this.minddaleClient, {email: this.email, subject: this.subject, message: this.message} as Contact);
      alert(status);
    }else {
      alert('Please enter valid contact info to post!');
    }
  }

Component Forms

In case you wanted to use the components as they are to show our ready-made pretty forms as newsletter section or contact section, just use them as any other component.

The minddale component needs the Client ID and Secret as it goes without saying, so is with newsletter component.

<fcx-mdl-newsletter [minddaleClient]="minddaleClient"></fcx-mdl-newsletter>

To use contact component as well, provide Client ID and Secret.

<fcx-mdl-contact [minddaleClient]="minddaleClient"></fcx-mdl-contact>

Note: In case you are not running the app from your registered domain (website), make sure you are setting the registered client domain as well in the input param.

Support

We, at Firecodex, would like to support anybody with queries or suggestions. Please feel free to reach out to us:

[email protected]

Happy Coding!