Giter VIP home page Giter VIP logo

ng-noty's People

Contributors

dimakuba avatar

Watchers

 avatar

Forkers

mattmccutchen

ng-noty's Issues

facing "Noty - not defined" error

Hi,
I have followed the readme instructions & imported it to a component to check.But i'm facing "Noty - is not defined" error.
Complete error description which I got in console is below.

ERROR ReferenceError: Noty is not defined
    at NgNoty.create (ng-noty.ts:11)
    at NotifyService.openNgNoty (notify.service.ts:21)
    at SafeSubscriber.eval [as _next] (login.component.ts:48)
    at SafeSubscriber.__tryOrUnsub (Subscriber.js:238)
    at SafeSubscriber.next (Subscriber.js:185)
    at Subscriber._next (Subscriber.js:125)
    at Subscriber.next (Subscriber.js:89)
    at CatchSubscriber.Subscriber._next (Subscriber.js:125)
    at CatchSubscriber.Subscriber.next (Subscriber.js:89)
    at MapSubscriber._next (map.js:83)

My complete code,
app.module.ts

import {NgNoty, NotyOptions} from "ng-noty";

@NgModule({
	...
  providers: [NgNoty]
  ...
})

notify.service.ts

import { Injectable,Component } from '@angular/core';
import {NgNoty, NotyOptions} from "ng-noty";
@Component({
  selector: 'app-notification',
  template: `
    <button (click)="openNgNoty()" aria-label="Show an example ng-noty">
      Show ng-noty
    </button>
  `,
})

@Injectable()
export class NotifyService {

  constructor(public ngNoty: NgNoty) { }

  openNgNoty() {
  	console.log('check'); // console works

    this.ngNoty.create(<NotyOptions>{ // Facing error here
        text: 'Some notification text'
    }).show();
  }

}

login.component.ts

...
import { NotifyService } from '../notify.service';

...

export class LoginComponent implements OnInit {

	constructor(private notify:NotifyService) {}

	onSubmit() {
		cnosole.log('check'); // console works
    this.notify.openNgNoty();
  }

}

Did I do anything wrong or what may be the problem ?

Regards,
Deepak

using noty buttons

I am trying to add buttons to message. I am new to typescript and I am not sure that I understand what is happening here, but I cannot seem to get the buttons added. It looks like NotyModel.button should create a NotyButton, but I am getting an error message.

NotyModel.button is not a function

This is how I am trying to use it:

this.noty.create({
text: 'Problems Encountered',
layout: 'bottomRight',
theme: 'bootstrap-v4',
type: 'error',
buttons: [
NotyModel.button('Ok', 'btn', () => {}, null)
]
}).show();

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.