اشتراکها
I just finished teaching the first week of a 9-week, super-intensive, hands-on boot camp that focuses on TypeScript/ASP.NET Web API/AngularJS. I decided to write a series of blog posts that describes each week of the camp. Who makes it. The challenges the students encounter. And, the material that we cover
اشتراکها
تغییرات مهم ASP.NET 5 و MVC 6
- هدف از بحث جاری صرفا «اعمال تزریق وابستگیها» هست.
- سری مباحث ASP.NET Identity 2,x را از اینجا شروع به مطالعه کنید. برای نمونه: «افزودن تصدیق ایمیل به ASP.NET Identity در MVC 5» و «Identity 2.0 : تایید حسابهای کاربری و احراز هویت دو مرحله ای » و «پیاده سازی یک سیستم دسترسی Role Based در Web API و AngularJs - بخش اول»
جهت اطلاع عموم
ASP.NET Identity 2.x یک پروژهی خاتمه یافته از دیدگاه مایکروسافت محسوب شده و دیگر پشتیبانی خاصی ندارد . نگارش بعدی آن ASP.NET Core Identity نام دارد.
- سری مباحث ASP.NET Identity 2,x را از اینجا شروع به مطالعه کنید. برای نمونه: «افزودن تصدیق ایمیل به ASP.NET Identity در MVC 5» و «Identity 2.0 : تایید حسابهای کاربری و احراز هویت دو مرحله ای » و «پیاده سازی یک سیستم دسترسی Role Based در Web API و AngularJs - بخش اول»
جهت اطلاع عموم
ASP.NET Identity 2.x یک پروژهی خاتمه یافته از دیدگاه مایکروسافت محسوب شده و دیگر پشتیبانی خاصی ندارد . نگارش بعدی آن ASP.NET Core Identity نام دارد.
- در مورد تنظیمات سمت سرور AngularJS 2.0 در ASP.NET Core 1.0، در قسمت «معرفی بستهی نیوگت Microsoft.AspNetCore.SpaServices» بحث شدهاست.
- اما ... Gulp جاوا اسکریپتی اساسا وابستگی خاصی به فناوریهای سمت سرور ندارد. در اینجا فقط نحوهی مسیردهی این پوشهها مهم هستند (و Task runner آن فقط به این مسایل دقت میکند):
در اینجا app/. به این معنا است که محل واقع شدن فایل تنظیمات gulp و همچنین فایل systemjs.config.js، یک سطح بالاتر هستند از پوشهی app (جایی که قرار است فایلهای اصلی از آن دریافت شوند) و همچنین پوشهی wwwroot ذکر شده (جایی که قرار است فایلهای نهایی کپی شوند):
- اما ... Gulp جاوا اسکریپتی اساسا وابستگی خاصی به فناوریهای سمت سرور ندارد. در اینجا فقط نحوهی مسیردهی این پوشهها مهم هستند (و Task runner آن فقط به این مسایل دقت میکند):
var appFolder = "./app"; var outFolder = "wwwroot";
gulpfile.js systemjs.config.js --app --wwwroot
نیازی به اینکار نیست (اگر Content-Type درخواست هم تنظیم شود). علت آنرا در مطلب «شروع به کار با AngularJS 2.0 و TypeScript - قسمت دهم - کار با فرمها - قسمت اول» توضیح دادم:
«... نکتهی مهم اینجا است که content type پیش فرض ارسالی متد post آن، plain
text است و در این حالت ASP.NET MVC شیء JSON دریافتی از کلاینت را پردازش
نخواهد کرد. بنابراین نیاز است تا هدر content type را به صورت صریحی در
اینجا ذکر نمود؛ در غیراینصورت در سمت سرور، شاهد نال بودن مقادیر دریافتی
از کاربران خواهیم بود...»
یک نکتهی تکمیلی
اگر میخواهید تمام مراحل ذکر شده را فقط با دو دستور ساده به پایان برسانید:
الف) ابتدا وابستگیهای nodejs را نصب کنید.
ب) سپس angular-cli را نصب کنید (اجرای دستور عمومی ذیل در خط فرمان):
ج) در آخر یک برنامهی جدید را شروع کنید (ابتدا از طریق خط فرمان به پوشهی مدنظر وارد شده و سپس دستور ذیل را صادر کنید):
اجرای همین چند مرحله، برای تشکیل قالب استاندارد شروع به کار با AngularJS 2.0 کفایت میکنند.
اگر میخواهید تمام مراحل ذکر شده را فقط با دو دستور ساده به پایان برسانید:
الف) ابتدا وابستگیهای nodejs را نصب کنید.
ب) سپس angular-cli را نصب کنید (اجرای دستور عمومی ذیل در خط فرمان):
npm install -g angular-cli
ng new AngularCLIDemoApp