Comments (5)
From the very start I knew that for UX reasons I wanted LearnAngular to be a single page app. Looking back, I think that this was the right design choice to make.
Completely unrelated to this is the fact that LearnAngular contains its fair share of client side code, notably to run the code editors. Data binding is essential to make this code simple and easy to maintain.
While Angular is not the only framework which is capable of fulfilling these requirements, it does the job quite nicely. The $location
API is superb, the Ajax method abstractions are easy to use and the data binding works beautifully. In short, Angular fits the bill for the app.
I definitely would not consider this to be "misuse".
from learnangular.
OK - but is it possible to implement 'real' urls for every page?
i.e. Issuing a normal GET to any URL should return the expected content. There are so many benefits to this (at least for content sites) in terms of accessibility, SEO, accessibility, caching that it's not something that should be discarded lightly.
from learnangular.
Those are good points, but both issues that you bring up are taken care of in LearnAngular.
Caching on the client side is handled no problem. You can see this when switching back and forth between pages. The first switch entails a delay; subsequent switches are for all intents and purposes instantaneous. On the server side, caching is enabled for all Ajax endpoints and is handled in the exact same way as it would be for a request demanding an entire page. As far as it is concerned, there is no functional difference between a GET request to mysite.com/mypage
and a GET request made to mysite.com/content?url=mypage
, which is essentially what is being done here.
SEO is handled using Google's escaped_fragment protocol, which provides a way for SPAs to communicate their content to search engines. Implementing escaped_fragment compliance does indeed require a small amount of additional work, however I make use of an open source library that I wrote which does the heavy lifting for me. Google therefore indexes the real content of each page and not just the HTML which is the same for each URL.
from learnangular.
There's a lot more to caching than just the client.
And 'escaped_fragment' is bit of a hacky workaround.
Single page apps that require javascript are not a problem but if we end up in a place where normal content pages requires a javascript interpreter then we have broken one of the fundamental building blocks of the web.
And there is no need to do this. We have the tools and the techniques to get all the benefits of partial page loading and dynamic content without re-rendering AND still maintain a clean GETable web.
It's a now basically a philosophical disagreement and the arguments against a javascript-only web are many and complex. I have a feeling we will not reach an agreement on this in a Github ticket. It's a shame though.
from learnangular.
I think that we're going to have to agree to disagree regarding caching/SEO 😄. As I said, caching is handled both on the client and server side quite effectively (I think it shows in the final result) and Google's done a great job indexing the site using escaped_fragment.
You are absolutely correct though, it is a philosophical discussion, and there's nothing wrong with that! Angular itself has its fair share of detractors for the reasons you outlined. I wrote the site to be an aid for those attempting to grasp Angular's steep learning curve. It was never intended to be an advertisement for the product and hope that people won't take it as such. 😄
from learnangular.
Related Issues (20)
- Make the left-side menu navigation offer proper links for copying or opening in a new window HOT 3
- Consider using single quotes ' in JavaScript instead of double quotes " HOT 2
- Ambiguous syntax explanation in the $watch tutorial HOT 3
- ... learn which version of angular? HOT 2
- Page Not Found: Dependency injection for five year olds HOT 2
- User data is not being saved in AJAX tutorial HOT 2
- Run not showing results HOT 4
- Amazing explanation HOT 1
- The Value Recipe needs some update HOT 5
- Nice explanation. One more point. HOT 3
- First Lesson: Simple App doesn't display HTML correctly HOT 9
- Constant recope HOT 3
- First lesson bug HOT 2
- Binding CSS classes HOT 1
- extra code in Two-way bindings lesson HOT 1
- aesthetics issue in repeaters HOT 1
- Syntax error causes fields to be uneditable
- lol :D HOT 1
- Where can we find the .css files? HOT 1
- The tutorial no longer work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from learnangular.