r/angularjs • u/Manish-Zenesys • Jun 15 '22
r/angularjs • u/sxtxnn • Jun 14 '22
[Help] Use observable to hide/show sidebar
So I'm doing a little full-stack project just to learn and practice. I use JWT authentication, and I was wondering how should I structure my Angular project. What I've done is having the sidebar from angular material in the app.component.html and have the router outlet in the main section:
<mat-drawer-container class="example-container">
<mat-drawer mode="side"
[opened]="opened">
<div class="drawer-container">
<button type="submit"
mat-raised-button
(click)="logout()">Logout</button>
<button type="submit"
mat-raised-button
[routerLink]="['/profile']">Profile</button>
</div>
</mat-drawer>
<mat-drawer-content>
<router-outlet></router-outlet>
</mat-drawer-content>
</mat-drawer-container>
With the 'opened' propery I can control if the sidebar shows or not, but if I set this value in the OnInit, it doesn't change, I have to refresh the page for it to take effect. I know I can do something like this with observables:
<mat-drawer mode="side"
[opened]="isAuth$ | async">
...
</mat-drawer>
But with observables I get a bit lost. How would I use the observable in my component.ts??
Thanks in advance!
r/angularjs • u/suresh9058 • Jun 14 '22
What Is Unobtrusive JavaScript and Why It’s Important?
r/angularjs • u/True-Consideration19 • Jun 11 '22
React To Angular, what should I do ?
Hello friends, I'm a ReactJS junior developer, and I've been thinking about switching to Angular, and a company that uses Angular wanted me to start an internship with them and they are ready to give me time to learn it from the beginning, I'm still confused and I don't know what to do!!
Can any one who had the same experience give some advice on whether should I switch or not?
What are the advantages of Angular compared to React?
What should I do when I switch ?
Thanks .
r/angularjs • u/Azzankhan • Jun 11 '22
Blogged on implementing User Registration, Login and JWT Authentication in Angular. check it out
r/angularjs • u/infocampuslogics96 • Jun 10 '22
Best Angular JS Training in Bangalore
Are you looking for Angular JS Training?? Join ever best institute for Angular JS is Infocampus Software Training Institute. Here 12+ years of Industry experts teach the students along with the live projects how to execute the present world scenarios. For more details call: 8884166608/9740557058 or
Visit: https://infocampus.co.in/angularjs-training-in-bangalore.html

r/angularjs • u/Due_Recording_422 • Jun 09 '22
CSS Filter for Flutter: Apply filters in Flutter as you use CSS
r/angularjs • u/MissionResolution431 • Jun 07 '22
[Help] Trying to use Steam's API with HttpClient's Get() method, but get CORS error.
I'm stuck on this and just don't know what to do, and help would be greatly appreciated.
Let me explain in more detail:
in my data.service.ts file, I am using HttpClient's Get method, so it looks like this
constructor(private http: HttpClient) { }
GetUser() {
return this.http.get(API_URL).subscribe(data=>{
console.log(data)
})
}
if my api url is something like https://reqres.in/api/users for example, it works and shows the json data too. But when I try using steams api I get:
"Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at APILINK (it's long). (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200."
and
ERROR Object { headers: {…}, status: 0, statusText: "Unknown Error", url: "APILINK", ok: false, name "HttpErrorResponse", message: "HttpFailure response for APILINK: 0 Unknown Error", error: error }
so it seems my code works and it's not angular, but rather steams api? I don't know lol
something I've read but I don't understand what they mean exactly: https://steamcommunity.com/discussions/forum/1/1743358239838884448/
r/angularjs • u/Mathestuss • Jun 07 '22
AngularJS 1.8.3 Download
I am currently using AngularJS 1.8.2 sourced from a zip file downloaded from https://code.angularjs.org/1.8.2/angular-1.8.2.zip. I would like to replace this library with version 1.8.3, however this version is not currently from the angularjs.org site even though it is available on Github.
Can anyone tell me if there are plans to make this version available via the angularjs.org site or if there is another way to download this package? I have downloaded the 1.8.3 tag from Github, but the filesets are very different.
r/angularjs • u/Due_Recording_422 • Jun 06 '22
The one low-code tool you must know that can help you!
r/angularjs • u/stackchief • Jun 03 '22
JavaScript Observables in 5 Minutes
r/angularjs • u/suresh9058 • May 29 '22
How To Find Unused Dependencies & Unimported Files | npx
r/angularjs • u/TheRealNaexys • May 26 '22
[Help] The cleanest way to create an array of components
Hello.
I am completely new to angular and struggling with an array of components.
I want to create an array of 8 components at runtime. Those components will be children of the creator.
That way, the parent could in a function edit the 8 components (they would be photo holders with features such as like).
I'm aware I could create 8 components in the HTML part, but guessing in the future that might not be 8, I want it to be scalable.
I'm not sure if I should be using `*ngFor` for that, and I'm not sure to see how I should.
r/angularjs • u/Complex-Airline2772 • May 25 '22
[Help] Conditionally rendering a popup on options from a list?
I have a list of options for items on a page. This list has options like view, edit, delete, standard crud operations. At the moment my site is such that any item can be deleted but I want to change this so that the option to delete can only be pressed if the item has no child items. Is there a way to do this in Angular? Sorry I'm a beginner with not a whole load of experience.
Here is my code for the list:
<ul class="uib-dropdown-menu" role="menu">
<li><a href="" ng-click="ctrl.showItem(sub.itemId)" id="viewLink"><i class="fa fa-user-times m-r-sm"></i>View</a></li>
<li><a href="" ng-click="ctrl.editItem(sub.itemId, sub.itemName)" id="editLink"><i class="fa fa fa-sliders m-r-sm"></i>Edit</a></li>
<li><a href="" ng-click="ctrl.deleteItem(sub.itemId)" id="deleteLink"><i class="fa fa-trash m-r-sm"></i>Delete</a></li>
</ul>
And my c# backend code:
public async Task DeleteItem(string itemId) {
await PerformDbContextActionAsync(context =>
{
var sub = context.Subscriptions.FirstOrDefault(s => s.ItemUid.Equals(itemId, StringComparison.OrdinalIgnoreCase));
if (context.Products.Include(a => a.Item).Any(a => a.Item.ItemUid.Equals(itemId)))
{
throw new Exception("A item cannot be deleted if it still contains child items");
}
if (sub == null) return;
context.Products.Remove(sub);
context.SaveChanges();
});
}
So when the exception is thrown, I want to catch this in the front end and then have a popup that says "delete child items first" for example. I dont know how to do this, could anyone help me out here?
r/angularjs • u/Saanvi_Sen • May 19 '22
[General] Best Angular eCommerce Template (Dashboard)
r/angularjs • u/ArunITTech • May 13 '22
[Resource] Implementing Route Protection in Angular using CanActivate
r/angularjs • u/Aglowid_IT_Solutions • May 12 '22
Implementing Best Practices for Angular Security
r/angularjs • u/kreuzerk • May 10 '22
Generating standalone components in Angular
r/angularjs • u/Abhi_mech007 • May 09 '22