We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I saw an old post of someone looking for jDrupal support for Angular 2. I'm a bit late but i got this working with Angular 4 (TypeScript).
npm install jdrupal
in angular.json under "scripts" i added: "node_modules/jdrupal/jdrupal.js"
using an import statement should have worked but i couldn't figure it out.
then in mypage.page.ts
import { Component, OnInit } from '@angular/core'; // import * as Drupal from 'jdrupal'; declare var Drupal: any; @Component({ selector: 'app-drupal-test', templateUrl: './drupal-test.page.html', styleUrls: ['./drupal-test.page.scss'], }) export class DrupalTestPage implements OnInit { constructor() {} ngOnInit() { Drupal.settings.site_path = 'http://qleva.liquidcms.org'; Drupal.settings.endpoint = 'rest'; this.initDrupal(); this.userLogin(); } initDrupal() { system_connect({ success: function(result) { // Prepare a message for the user. const text = result.user.uid === 0 ? 'Hello World' : 'Hello ' + result.user.name; // Show the message in the paragraph. document.getElementById('msg').innerHTML = text; } }); } userLogin() { user_login('qleva-admin', 'qpoiqpoi', { success:function(result) { document.getElementById('useremail').innerHTML = result.user.mail; }, error:function(xhr, status, message) { alert(message); } }); } }
The text was updated successfully, but these errors were encountered:
Not exactly sure what system_connect() does. Don't think it is really needed for anything.
Sorry, something went wrong.
No branches or pull requests
I saw an old post of someone looking for jDrupal support for Angular 2. I'm a bit late but i got this working with Angular 4 (TypeScript).
npm install jdrupal
in angular.json under "scripts" i added: "node_modules/jdrupal/jdrupal.js"
using an import statement should have worked but i couldn't figure it out.
then in mypage.page.ts
The text was updated successfully, but these errors were encountered: