Add drupal to exsisting Angular project - angularjs

I got a angular project and I want to add drupal to it.
I want the admin to be able to add new content in drupal which will show in a feed on my page.
Is this possible?
Been trying to find a guide but it seems like I'm out of luck.

If you have the services module installed you can find all available REST calls under the services tab.
If you want for example fetching nodes you can fire a request to www.your-backend.org/api/node/.
Or consume data for a view with www.your-backend.org/api/views/view-name
To Integrate this in you Angular forntend you can use ng-drupal-7-services.
This Module provides nearly all possible API calls to drupal as well as a module to easily handle authentication to you backend.
It sets:
session data
cookie data
X-CSRF Token
At drupanionic.org you will fin demos for plain angular and ionic.

Instead of using drupal 7 you can download drupal 8 which is in beta and provides a restful api service "out of the box".

Related

Integrate Salesforce Einstein chatbot in website built using Dot Net and Angular

I am trying to add chatbot feature to my website (built using .Net and Angular). So, I am thinking of using Salesforce Einstein Chatbot for it. But is it possible to add Einstein chatbot feature to my website as I don't see any results on google on how to integrate Einstein chatbot to external website built using .Net and Angular.
There's nothing special about Angular and out of the box chat uses only Salesforce, there's no .NET integration. What have you tried so far, what problems/errors you have? We are not a magical free code writing service.
After you finish configuring the bot you end up with a piece of JavaScript code you have to put on your site (can be in otherwise plain html page or Angular app or whatever)
If you don't have the bot yet, https://trailhead.salesforce.com/content/learn/modules/service_bots_basics and https://trailhead.salesforce.com/en/content/learn/projects/build-an-einstein-bot are good start.
Once you have it, go to Setup -> Embedded Service Deployments and you should find piece of HTML to inject into any page you want.
You might have to "Angularize" it, put the initialisation into page load event (How to execute AngularJS controller function on page load? ng-init? I don't know, I'm not Angular dev), maybe move styles to separate file.

Fetch facebook post in Angularjs application

I am new to angularjs. I would like to fetch my facebook post in Angularjs application.
Kindly advice me how to start up this process through Angularjs.
Thanks in advance!
Please start exploring all Facebook API's for authorizing in different domain.Below is the Facebook API document which might help you to understand on how to get authorized to use FB API's
https://developers.facebook.com/docs/javascript
https://developers.facebook.com/docs/javascript/howto/angularjs - it will create a setup like plugins inside your app after you include it in your angularjs app.
For AngularJs app please create a angular scaffolding templates using Yoeman
generator for project setup - cmd - 'yo angular' will help you to
create angularjs application.
To run your application locally / to create proxies/ to build and zip use -
GruntJS
To check your dependencies for your project use bower/npm
Basically you need angular, angular-route, angular-resources as your
dependency to your application.
Start exploring about angular route,angular module,controllers,services,directives in angularjs website.

Single App with Symfony 3 and Angular 2 (Routes)

Currently I have an application built with Angular 2 (all the front-end side) and Symfony 3 (web framework) . I have defined each view as an Angular application.
I think it's the time to migrate to a Single App but I have some questions before I venture into the lion's den.
If a user change manually the URL, of course, they, should enter to the requested URL, but how can angular know which url is trying to open?
I should create multiple controllers or only one that catch all the requests?
If none of above are the right way, please, can you suggest any way to do it?
Thank you so much.
If you're trying to build a Single Page application, it means that your routes will be managed by your front-end, here by Angular 2 via #angular/router.
Symfony can then be only used as a back-end web service (i.e. a Restful API) that will answer to your front-end calls via JSON responses. Depending on the size of your API, you may wish to use FOSRestBundle for that purpose.
So you don't have to worry about Symfony routing interpretation since your urls will be managed by Angular router. Symfony routes will be called directly by your Angular application to get/post/put/delete/patch your back-end data.
UPDATE
To answer you comment, a user who directly enters a URL will simply see the page you linked to this url via Angular routing, there is (almost) no difference between front-end and back-end routing.
If you want to dive deeply in how hash routing works in javascript, you can check this article.
To see a real-life example of a SPA with full Angular routing, ga.me is a good start.

How to use groundDb package in Ionic + angular application?

I have an ionic + angular application and we have used Meteor DDP at server, at present we have created client side collection in minimongo database which is created in clientside memory. which gets clear when user removes application from memory.
I want support offline feature & persistent storage on client-side, so when application goes to offline mode it should display data from local database.
I found GroundDB suits better in my project but the challenge is there no out of box GroundDB package to include in ionic project.
Do anyone have used GroundDB in ionic + angular project? if yes please share steps to include GroundDB.
I also know that Meteoric is the solution for this but I dont want to use Meteor for frontend, I want to use AngularJS.

I need to implement Asp.net Web API 2 and consume it by Sencha Ext JS

I want to implement a web-based API (using ASP.NET Web API 2) and consume it by the client Side library (Sencha Ext JS).
My application should include
A simple user registration form.
A login page for admin.
CRUD operations for users' submissions.
Notes:
I do not want to include any backend code (i.e C#) in the we application, I want to implement it using the HTML/Javascript only, that is Ext JS.
I want the Web API to be RESTful.
I want to protect admin pages.
I want to use the SQL Server to store users' submissions.
All of that requirements should be implemented using the ASP.net Web API 2 and Ext JS only.
So far, I did initial search and I got a lot of learning for either the ASP.net API 2 or the Ext JS. But I couldn't have a guide that help me to fulfill the above requirements or help me to have both technologies work together.
Pleas help me on either way.
Or generally, can you help me get started work in combining both: Asp.net Web API 2 and any client side that consumes it, such as Sencha Ext JS or any other client side. It is not necessarily to be Ext JS.
Thank you so much.
Thanks to StackOverflow.com
If it were me, I'd use the DirectAPI for asp.net https://github.com/elishnevsky/ext-direct-mvc
You create webapi controllers, just like you normally would. The only difference is the the controllers that need to be used by EXT should inherit from DirectController.
If you follow the directions on that page, you'll end up with a globally available proxy object that matches the name of the controller and the public methods hanging off of the controller become methods of that object.
That is, server side controller MyAwesomeController with method DoSomething() becomes MyAwesome.DoSomething.
If you attribute the method as [NamedArguements] you can create methods such as
DoSomething(int id, int foo)
and pass from javascript as DoSomething({id: 20, foo: 30});
Since it is still just a controller, you can attribute permissions and return json as you would in any other situation.
If you get stuck, use the debugger and spend the time to figure out what's really going on. This all works in 4.x and I've tried it in 5.x and it still works there as well. But I wouldn't jump into 5.x just yet as there are still several bugs that need to be worked out by the sencha team before it is ready for prime time.
ExtJs has a REST proxy for the data. So what you try to do should be possible. The proxy can be configured and be finetuned.
I used the JSON proxy. ExtJs has very powerful filter and sort capabilities, both server and client side. In my experience difficulties arose when filtering and sorting server side. There is only sparse documentation on how the parameters are passed and which configurations have what effects.
Since you also develop the REST api, you can adapt to those details. You just have to do some research.
Here is not the place to ask about guides. For Asp I cannot help you, I never touched it. If you use ExtJs, you are free to choose you backend. For ExtJs, the start is pretty straight forward :
get Sencha cmd and generate a skeleton app.
follow the tutorial
create one file per class definition.
the API docs are great. If you still lack something SO is great too.
what you have to find out by yourself is the exact way parameters are passed to the backend and how to format the response.

Resources